title: Laravel 5.6 error multi login
body: <p>I'm trying to create multi login in laravel 5.6 and this error appeared, can anyone help me?</p>
  
  <p>Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_RECOVERABLE_ERROR)
  Type error: Argument 2 passed to Illuminate\Auth\SessionGuard::__construct() must be an instance of Illuminate\Contracts\Auth\UserProvider, null given, called in C:\wamp64\www\Laravel\Sistema\oficial\vendor\laravel\framework\src\Illuminate\Auth\AuthManager.php on line 123</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  namespace App\Http\Controllers\Auth;
  use Illuminate\Http\Request;
  use App\Http\Controllers\Controller;
  use Route;
  use Illuminate\Support\Facades\Auth;
  
  class EmployeeLoginController extends Controller
  {
  
      public function __construct()
      {
           $this-&gt;middleware('auth:employee');
      }
      
      public function login(Request $request)
      {
        $credentials = $request-&gt;only('email', 'password');
        if (Auth::guard('employee')-&gt;attempt($credentials)) {
          return redirect()-&gt;intended(route('admin.dashboard'));
        }
        return redirect()-&gt;back()-&gt;withInput($request-&gt;only('email', 'remember'));
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>guard:</p>
  
  <pre><code>&lt;?php
  
  return [
  
      'defaults' =&gt; [
          'guard' =&gt; 'web',
          'passwords' =&gt; 'users',
      ],
  
  
      'guards' =&gt; [
          'web' =&gt; [
              'driver' =&gt; 'session',
              'provider' =&gt; 'users',
          ],
  
          'employee' =&gt; [
              'driver' =&gt; 'session',
              'provider' =&gt; 'employees',
          ],
  
          'api' =&gt; [
              'driver' =&gt; 'token',
              'provider' =&gt; 'users',
          ],
      ],
  
  
  
      'providers' =&gt; [
          'users' =&gt; [
              'driver' =&gt; 'eloquent',
              'model' =&gt; App\User::class,
          ],
  
          'employee' =&gt; [
              'driver' =&gt; 'eloquent',
              'model' =&gt; App\Employee::class,
          ],
  
  
          // 'users' =&gt; [
          //     'driver' =&gt; 'database',
          //     'table' =&gt; 'users',
          // ],
      ],
  
  
      'passwords' =&gt; [
          'users' =&gt; [
              'provider' =&gt; 'users',
              'table' =&gt; 'password_resets',
              'expire' =&gt; 60,
          ],
      ],
  
  ];
  </code></pre>
  
  <p>ReditectIfAuthenticated</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Middleware;
  
  use Closure;
  use Illuminate\Support\Facades\Auth;
  
  class RedirectIfAuthenticated
  {
      /**
       * Handle an incoming request.
       *
       * @param  \Illuminate\Http\Request  $request
       * @param  \Closure  $next
       * @param  string|null  $guard
       * @return mixed
       */
      public function handle($request, Closure $next, $guard = null)
      {
          switch ($guard) {
          case 'employee':
              if (Auth::guard($guard)-&gt;check()) {
                return redirect('/dashboardemployee');
            }
  
            break;
          default:
              if (Auth::guard($guard)-&gt;check()) {
              return redirect('/home');
            }
  
            break;
        }
  
          return $next($request);
      }
  }
  </code></pre>
  
  <p>model:</p>
  
  <pre><code>&lt;?php
  namespace App\Models;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  
  class Employee extends Authenticatable
  {
      protected $guard = 'employee';
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'name',
          'email',
          'password',
          'photo',
          'status',
          'connect_email',
          'connect_senha',
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
          'password', 'remember_token',
      ];
     }
  </code></pre>