jeudi 3 janvier 2019

did not update Laravel 5.6 input values?

using laravel 5.6 and mysql. and going to update student table using following controller function?

public function update(Request $request, $id)
    {
        $students = Student::find($id);
        $students->name = $request->input('name');
        $students->town = $request->input('town');
        $students->save();
 } 

and update form action is as following,

<form action="" method="POST">
    

and my route is like this,

Route::resource('student','StudentController');

but when I click update button in the form it is generate following error msg, 1/1) MethodNotAllowedHttpException

how can I fix this problem?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire