hasen39
358
3
Laravel

i cant retrieve authenticated user data

Posted 5 months ago by hasen39

i have a Registerar Guard and my view code is


<div class="mr-5 dropdown">
        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span> {{$Registerar['username']}}</span>
          <i class="fas fa-user"></i>
        
        
        </a>
        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
          <a class="dropdown-item" href="{{route('Registerar.LogOut',['id'=>$Registerar['username']])}}">Log Out</a>
          <a class="dropdown-item" href="{{route('Registerar.Profile',['id'=>$Registerar['username']])}}">Profile</a>
    </div>

i have service provider

public function register()
    {
        //
    }

    /**
     * Bootstrap services.
     *
     * @return void
     */
    public function boot()
    {
        $Registerar=Auth::guard('Registerar')->user();
        View::share('Registerar',$Registerar);
    }

And my Route is

Route::prefix('Registerar')->name('Registerar.')->middleware('Registerar')->group(function(){
    Route::get('{id}/LogOut','Registerar\[email protected]')->name('LogOut');
    Route::get('{id}/Profile','Registerar\[email protected]')->name('Profile');
});

Please sign in or create an account to participate in this conversation.