Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Created September 21, 2017 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/27ba5ab0832e4bd736f017efe89dadf3 to your computer and use it in GitHub Desktop.
Save uno-de-piera/27ba5ab0832e4bd736f017efe89dadf3 to your computer and use it in GitHub Desktop.
<?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