Form Validationを作る
$ php artisan make:request 作りたいファイル名
# 例
$ php artisan make:request TestRequest
authorizeのreturn値はtrueに変更する
public function authorize()
{
return true;
}
エラー時の要素名の変更
:attribute
部分が置き換えられます。
public function attributes()
{
return [
// 書式
'formの要素名' => 'エラーメッセージのFormの要素名に出力したい文字列',
// 例
'user' => 'ユーザ名',
'email' => 'メールアドレス',
];
}