0
I would like to save the route in the database.
So I saved it like this. Example:
Route table
| id | rota |
| 1 | route( 'login' )
Then I would like to recover and use as route even in Laravel, in Blade.php
I’m trying to do it like this:
<a href="{{ $rota->rotas }}">Link</a>
It shows the text as a link and not the route link
http://localhost/route('login')
Is it possible?
Convert the text that came from the database to the route itself?
I would not like to save the url anyway, because your change the url I will have to go in the bank, but if it is the way I change
Saving only 'login' in the database and in the <a href="{{ route($route->routes) }}">Link</a> view would not solve?
– Marcos Xavier
It won’t. It show the string
– adventistaam
In case you set a route in the database, or want you can call these routes by the database, for example route
login
would return the login name path, or when setting this route in the database it would exist?– Bulfaitelo
I want to save the route in the database. I’d like to call the route through the database.. That even when calling login, return I could mount route('login')
– adventistaam
I don’t understand why it will show the string. If you use the route helper('column of the database') you should show what you have there. Ex https://implode.io/C0qPqH
– Marcos Xavier
Exactly. It shows what is in the bank and not route that I would like. Ex.: If I saved in the bank
route('login')
, and try to put in the url like this:<a hre="{{ $rota }}">rota </a>
when I pass the cursor over the url it shows so:localhost://meuapp/route('login')
not the url configured on the route that would belocalhost://meuapp/login
– adventistaam
Use the route helper. Test with {{ route($route) }}
– Marcos Xavier
I will search how to use this route helper
– adventistaam
You have an example of what it would be like.. The ones I found would not solve
– adventistaam
In my previous comment I had already written route('login'), this already creates the url for the link. <a href="{ː route($rota) }}">CLICK</a>
– Marcos Xavier
Let’s go continue this discussion in chat.
– Marcos Xavier