validationを纏めるファイル

[vagrant@localhost laravel]$ php artisan make:request ArticleRequest
Request created successfully.

サーバーを再起動
php artisan serve –host 192.168.35.10 –port 8000

appの中のhttpの中にできる

ArticleRequest

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ArticleRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            //
            'login_id' => 'required|min:3',
            'role' => 'required|min:2',
            'name' => 'required|min:2',
            'password' => 'required',
            'mail' => 'required',
            'test_mail' => 'required',
            'updated_person' => 'required|min:3'
        ];
    }
    public function messages(){
        return [
            ''
        ];
    }
}