Last active
October 26, 2017 12:15
-
-
Save Konafets/58a95272fef1682c227dfd1d37968fc8 to your computer and use it in GitHub Desktop.
Validation via FormRequest
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 namespace App\Http\Requests; | |
use Illuminate\Foundation\Http\FormRequest; | |
class PostStoreRequest extends FormRequest | |
{ | |
public function authorize() | |
{ | |
return true; | |
} | |
public function rules() | |
{ | |
return [ | |
'title' => 'required|unique:posts|max:255', | |
'body' => 'required', | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment