%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/calling_code/app/Http/Controllers/Auth/
Upload File :
Create Path :
Current File : //home/silvzytp/calling_code/app/Http/Controllers/Auth/LoginController.php

<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{

    use AuthenticatesUsers;

    /**
     * Where to redirect users after login.
     *
     * @var string
     */
    protected $redirectTo = RouteServiceProvider::HOME;
    protected function redirectTo(){
        if (Auth::check() && Auth::user()->role->slug == 'super-admin') {
            return route('super.dashboard');
        }elseif(Auth::check() && in_array(Auth::user()->role->slug,['admin','manager','agent']) == true){
            return route('app.dashboard');
        }else{
            return route('login');
        }
    }

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest')->except('logout');
    }
}

Zerion Mini Shell 1.0