Created
January 27, 2015 11:43
-
-
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/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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