Created
September 21, 2017 13:28
-
-
Save uno-de-piera/27ba5ab0832e4bd736f017efe89dadf3 to your computer and use it in GitHub Desktop.
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 | |
public function store() { | |
$this->_validate(); | |
User::create( request()->input() ); | |
return new JsonResponse( [ 'message' => 'success' ] ); | |
} | |
protected function _validate() { | |
$this->validate( request(), [ | |
'name' => 'required|unique:users', | |
'email' => 'required', | |
] ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment