我正在使用Laravel 5.5。当我点击编辑按钮时出现错误"抱歉,找不到您要查找的页面。"。真奇怪的事情
web.php
/* View booking history */
Route::get('/booking/history', 'BookingController@index')->name('booking.history');
/* Download voucher */
Route::post('/booking/history/voucher/download', 'BookingController@downloadVoucher')->name('booking.history.voucher.download');
/* Delete cancelled booking */
Route::post('/booking/history/delete/cancelled/booking', 'BookingController@destroyCancelledBooking')->name('booking.history.delete.cancelled.booking');
/* Delete waiting prepay booking */
Route::post('/booking/history/delete/waiting/prepay', 'BookingController@destroyWaitingPrepayBooking')->name('booking.history.delete.waiting.prepay');
/* Delete approved inquiry booking */
Route::post('/booking/history/delete/approved/inquiry', 'BookingController@destroyApprovedInquiry')->name('booking.history.delete.approved.inquiry');
/* Delete waiting inquiry booking */
Route::post('/booking/history/delete/waiting/inquiry', 'BookingController@destroyWaitingInquiry')->name('booking.history.delete.waiting.inquiry');
/* Delete rejected inquiry booking */
Route::post('/booking/history/delete/rejected/inquiry', 'BookingController@destroyRejectedInquiry')->name('booking.history.delete.rejected.inquiry');
/* Cancel booking */
Route::post('/booking/history/cancel', 'BookingController@cancelBooking')->name('booking.history.cancel');
/* Edit booking history */
Route::get('/edit/booking/history/{id]', 'BookingController@edit')->name('edit.booking.history');
/* Update booking history */
Route::post('/edit/booking/history/{id]', 'BookingController@update')->name('update.booking.history');
booking.blade.php
<a href="/edit/booking/history/{{ $booking->_id }}" class="btn btn-list-history" style="color: inherit;">{{ __('bookingHistory.editBooking') }} <span class="glyphicon glyphicon-wrench"></span></a>
BookingController.php
public function edit($id)
{
dd($id);
}
答案 0 :(得分:0)
在路线中使用{}
括号作为参数段。
像这样:
Route::get('/edit/booking/history/{id}'