Answer the question
In order to leave comments, you need to log in
Where is the right place to specify the function to form the URL?
Good afternoon.
I have a dilemma.
Where is the right place to specify the function to get the url of the model?
In many sources, the function is simply written in the template as path_for (router, parameters).
But I don't want to use this, I plan to add a slug and change the URL in the future.
Now it’s done in the model (Eloquent) through url (view on the site), url_admin_edit (edit url in the admin panel), but in this case the problem is that you have to write all the routers to the model and I can’t stick the url of adding a new entry to the model .
How to do it right?
Perhaps chaotically written
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question