Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using laravel 5.3, and using Hesto/multi-auth package. All my home.blade is working fine, in my nav bar it returns the current login user. But everytime I created a new view, and extend my nav bar to it my nav bar shows "LOGIN REGISTER" instead of username even though I'm already logged in.

So, when I'm in home.blade I successfully logged in as a user, but when I navigate to another view, I am read as a guest. As a sample, I experimenting my welcome.blade.

This is my route for one of my user.

Route::group(['prefix' => 'customer', 'middleware' => 'customer'], function () {


Route::model( 'customer' , 'App\Customer' );
  Route::get('/login', 'CustomerAuth\LoginController@showLoginForm');
  Route::post('/login', 'CustomerAuth\LoginController@login');
  Route::post('/logout', 'CustomerAuth\LoginController@logout');

    Route::get('registration_form', function()
    {
        return view('customer/auth/registration_form');
    });
    Route::post("register_customer", 'CustomerAuth\RegisterController@register');

  Route::post('/password/email', 

'CustomerAuth\ForgotPasswordController@sendResetLinkEmail');
      Route::post('/password/reset', 'CustomerAuth\ResetPasswordController@reset');
      Route::get('/password/reset', 'CustomerAuth\ForgotPasswordController@showLinkRequestForm');
      Route::get('/password/reset/{token}', 'CustomerAuth\ResetPasswordController@showResetForm');
    });


Kernel.php

protected $routeMiddleware = [
       'business' => \App\Http\Middleware\RedirectIfNotBusiness::class,
       'business.guest' => \App\Http\Middleware\RedirectIfBusiness::class,
       'customer' => \App\Http\Middleware\RedirectIfNotCustomer::class,
       'customer.guest' => \App\Http\Middleware\RedirectIfCustomer::class,
       'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
       'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
       'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
       'can' => \Illuminate\Auth\Middleware\Authorize::class,
       'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
       'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
   ];


What I have tried:

I tried extending navbar to my welcome.blade
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900