Skip to content

Instantly share code, notes, and snippets.

@dancourse
Created January 20, 2015 15:29
Show Gist options
  • Save dancourse/ce3b6bd07e509fc0e746 to your computer and use it in GitHub Desktop.
Save dancourse/ce3b6bd07e509fc0e746 to your computer and use it in GitHub Desktop.
What should I pass back on a Custom Laravel Validation fail?
/**
* 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