I am trying to add validation in the controller but it does not work with auth:check. This is the Laravel version 5.7.
This is the function store that has a problem with the validation.
public function store(Request $request)
'first_name' => ['required'|'min:2'|'max:50']
$player = Player::create([
'first_name' => $request->input('fist_name'),
'last_name' => $request->input('last_name'),
return redirect()->route('players.show', ['player'=> $player->id])
->with('success' , 'foo');
return back()->withInput()->with('errors', 'Foo Error');
from Newest questions tagged laravel-5 – Stack Overflow https://ift.tt/2Ja0CDq