Created
January 20, 2015 15:29
-
-
Save dancourse/ce3b6bd07e509fc0e746 to your computer and use it in GitHub Desktop.
What should I pass back on a Custom Laravel Validation fail?
This file contains 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
/** | |
* Check the user id is the Auth'd user id | |
* | |
* @param string $attribute | |
* @param mixed $value | |
* @return bool | |
*/ | |
protected function validateUserIdIsAuthUserId( $attribute, $value ) | |
{ | |
if($value===Auth::user()->id) | |
{ | |
return $value; | |
} | |
return false; // ? what should I return on fail? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment