Search code examples
laravel-5laravel-5.1laravel-5.3

syntax error, unexpected '}' in Anchor Laravel


My Anchor Tag is like below

<a href="{{ route('login') }}">Login</a>

I tried to change it to Laravel like below

{{ HTML::link("{{ route('login') }}", 'log in')}}

It says syntax error, unexpected '}'

Am I missing something?


Solution

  • You can use the result of the function route directly as a parameter of link:

    {{ HTML::link(route('login'), 'log in') }}