Answer the question
In order to leave comments, you need to log in
How to display category slug in Laravel post?
Guys, how to display the category slug in a post in Laravel so that the link is like this: domain/category/post-name. I searched everywhere - both in Runet and in the bourgeoisie, but I did not find anything.
If you know, please show an example or at least throw off a link if you also encountered a similar problem.
Answer the question
In order to leave comments, you need to log in
Form a slug
Write to the database, make a route
route in template
In the controller, you take arguments and look for a post by slug builder->where('slug',$slug)->firstOrFail();
parameters in routes
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question