lundi 19 avril 2021

Laravel 5.7 validation works still not

I have already asked question about Laravel 5.7 validation, however it still does not work quite right. the validation is not executed at all when sending the content.

 public function update(Request $request, Player $player)
    {
        if(Auth::check()){
                       
            $playerUpdate = Player::where('id', $player->id)
                                ->update([
                                       'first_name' => $request->input('fist_name'),
                                       'last_name' => $request->input('last_name')
                                ]);
 
            if($playerUpdate){
                return redirect()->route('players.show', ['player'=> $player->id])
                ->with('success' , 'player foo');
            }
            
 
        }
         
        return back()->withInput()->with('errors', 'Foo error');
        
        
        
    }

enter image description here

Thanks in advance



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire