简体   繁体   中英

How can I insert database value in LARAVEL herf route name

How can I insert database value in Laravel href route name? Is this possible?

<a href="{{route('user.{{$adminbank->link}}')}}">{{$adminbank->bank_name}}</a>

Assuming that your route name is something like user.show and $adminbank->link is "show":

<a href="{{route('user.' . $adminbank->link)}}">{{$adminbank->bank_name}}</a>

(Don't use {{ }} inside {{ }} )

Try this:

<a href="{{route("user.{$adminbank->link}")}}">{{$adminbank->bank_name}}</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM