Reputation: 849
I want to pass a link with ID and show the title of this id in URL [SEO] without using any Model
<a href="/salons/{{ $salon->id()}}" >Book Appointment</a>
Upvotes: 0
Views: 435
Reputation: 1050
You can do one thing, Pass id from here and in controller get data from id, title but when page render you can use javascript replace state.
You can replace your id with title once page render.
It will just replace your url.
And also you have to put there condition that if title is integer when click on link (In which you passed id) you have to fetch data based on id for that you can use laravel when
method for conditional data fetch. And if slug passed (When page rendered and title is replaced with id) you have to fetch it based on title-slug.
Hope it helps :)
Upvotes: 1