Skip to content

Instantly share code, notes, and snippets.

@coreymcmahon
Created January 27, 2015 11:43
Show Gist options
  • Save coreymcmahon/27a5d07f6597121e5781 to your computer and use it in GitHub Desktop.
Save coreymcmahon/27a5d07f6597121e5781 to your computer and use it in GitHub Desktop.
BaseController.php - A Pattern for Reusable Resource Controllers in Laravel 4.2 http://slashnode.com/reusable-resource-controllers/
<?php
/** ...etc */
/**
* @param array $fields
* @return array
*/
protected function data($fields = array())
{
$rules = $this->validator->getRules();
return \Input::only(array_keys($rules));
}
/** ...etc */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment