This is my TaskController where complete() function is defined to store done_at current time
public function complete($id)
{
    $task = Task::create([
        'done_at' => now(),
    ]);
    return redirect()->route('tasks.index')->withSuccess('Done');
}
This is my web.php route
Route::post('/tasks/complete', 'TaskController@complete');
This is my index page where there is submit button to save current time
<form action="" method="post">
                        @csrf
                        <input type="submit">
                    </form>
via Chebli Mohamed
 
Aucun commentaire:
Enregistrer un commentaire