Passing a $username to the @include file in laravel -
Passing a $username to the @include file in laravel -
i'm trying pass $username after log in @include(header.blade.php) can username @ top of business relationship pages. how can this?
----- header.blade.php
<ul class="nav navbar-nav navbar-right"> <li><a href="/profile/">good day, {{ $username should go here }} </a></li> <li><a href="/logout/">logout</a></li> </ul> ----- layout.master
<!doctype html> <html> <head> <meta charset="utf-8"> @include('includes.head') </head> @include('includes.header') @yield('content') @yield('frontoffice') @include('includes.footer') <body> </body> </html>
you can create utilize of auth
@if(auth::check()) {{ auth::user()->username}} @else invitee @endif laravel laravel-4
Comments
Post a Comment