Answer the question
In order to leave comments, you need to log in
How to form a link in the blade template so that the id is in the middle?
For example, there is a link books.local/admin/authors/1/edit
Instead of one, there can be any number that matches the id.
Tried to do that
<a class="btn btn-primary" href="{{url('admin/authors/{$author->id}/edit')}}">Edit</a>
Answer the question
In order to leave comments, you need to log in
https://laravel.ru/docs/v5/helpers#url-%D0%B0%D0%B...
https://laravel.com/docs/5.6/urls
It is convenient to use named routes.
In routes:
Then we get the link like this:
Or, if $author is the corresponding model, then even like this:
Get the address of the formhttp://domain.name/аdmin/authors/123/edit
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question