Я пытаюсь добавить новую кнопку для возврата использованной карты. Я не уверен, почему данные не отправляются с запросом.
вот мой index.blade.php
<form action="{{ route('assignees.destroy',$assignee->id) }}" method="POST">
<a class="btn btn-info" href="{{ route('assignees.show',$assignee->id) }}">Show</a>
<a class="btn btn-primary" href="{{ route('assignees.edit',$assignee->id) }}">Edit</a>
<a class="btn btn-info" href="{{ route('returncard',$assignee->id) }}">Return Card</a>
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger">Delete</button>
</form>
и вот мой контроллер, где я определяю маршрут карты возврата:
public function returncard(assignee $assignee)
{
//
$assignee->timeout = now();
$assignee->update();
return redirect()->route('assignees.index')
->with('success','assignee updated successfully');
}
web.php:
Route::resource('assignees','AssigneeController');
Route::get('autocomplete', 'AssigneeController@autocomplete')->name('autocomplete');
Route::get('searchcard', 'AssigneeController@searchcard')->name('searchcard');
Route::get('returncard', 'AssigneeController@returncard')->name('returncard');
вывод dd ($ assignee)
Assignee {#266 ▼
#fillable: array:9 [▼
0 => "cabinet"
1 => "custidno"
2 => "timein"
3 => "timeout"
4 => "refnumber"
5 => "cardno"
6 => "refnumber"
7 => "entrytype"
8 => "notes"
]
#connection: null
#table: null
#primaryKey: "id"
#keyType: "int"
+incrementing: true
#with: []
#withCount: []
#perPage: 15
+exists: false
+wasRecentlyCreated: false
#attributes: []
#original: []
#changes: []
#casts: []
#dates: []
#dateFormat: null
#appends: []
#dispatchesEvents: []
#observables: []
#relations: []
#touches: []
+timestamps: true
#hidden: []
#visible: []
#guarded: array:1 [▶]
}
при нажатии любой кнопки ничего не происходит, а время ожидания не обновляется.