Reputation: 41
I have my code supported by Blade syntax in resources\views which is working then there is an automated coded from laravel framework in storage\framework\views written in PHP.
Blade
PHP
I am expecting to get the same result from blade syntax, but I have a syntax error converting to PHP
Upvotes: 2
Views: 57
Reputation: 1733
you're getting an error cause when you use a blade directive, you don't need to use {{ }}
to get a variable value, so the right syntax is:
@if ( Auth::guard("employee")->check() )
...
@endif
one more thing, the check()
method returns a boolean so you can't chain with the user()
method. so what you need to do is
@if ( Auth::guard("employee")->check() )
<p>welcome {{Auth::user()->name}} !<p>
@endif
Upvotes: 2