Nothing any update with put method in Laravel 8


I’m currently creating a simple todo-list in Laravel 8 and want to be able to update the items of the list.
My code doesn’t get any error but also nothing changes when I put the submit button.


<form action="{{ route('index.update', $task->id) }}" method="POST">
   <td><input type="text" name="content" value="{{ $task->content }}" id=""></td>
   <td><input type="submit" value="Update"></td>


use Illuminate\Support\Facades\Route;
use App\Http\Controllers\TaskController;

Route::resource('index', TaskController::class);


public function update(Request $request, Task $task)
        'content' => 'required',

    return redirect('index');


As @rwd said, the problem is with the route definition. Change it to:

Route::resource('tasks', TaskController::class);

Then in the form:

<form action="{{ route('tasks.update', $task->id) }}" method="POST">

Answered By – Rouhollah Mazarei

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published