I have a view page which i need to add a link to redirect the user to a booking page. I’m not so familiar with PHP so any guides would be helpful.
JavaScript
x
<td>
@if ($place->status==0)
<span> Available </span>
@endif
@if ($place->status==-1)
<span> Not Available </span>
@endif
@if ($place->status==2)
<span> Booked </span>
@endif
</td>
This is the table i have, and i need to add a link next to the of Available to redirect to another page called “quickbookingmodal.blade.php”. This file is basically a pop up menu to add bookings into the system.
Advertisement
Answer
Hi. You can do this :
JavaScript
@if ($place->status==0)
<a href="{{ route ('quickbookingmodal')}}">Available</a>
@endif
In your file route :
JavaScript
Route::get('/quickbookingmodal','bookingController@index')->name('quickbookingmodal')
Make sure you got an bookingController with :
JavaScript
function index() {
return view ('/quickbookingmodal')
}