[英]When I click on hyperlink I am getting page not found in Laravel
I am using Laravel 5.5. 我正在使用Laravel 5.5。 When I click on edit button I am getting error "Sorry, the page you are looking for could not be found.". 当我单击编辑按钮时,出现错误“抱歉,找不到您要查找的页面。”。 Really strange thing 真的很奇怪
web.php 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 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 BookingController.php
public function edit($id)
{
dd($id);
}
Use {}
brackets for parameter segment in your route. 在路径中的参数段上使用{}
括号。
Like this: 像这样:
Route::get('/edit/booking/history/{id}'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.