app/Http/Controllers/Auth/AuthenticatedSessionController.php
/**
     * Handle an incoming authentication request.
     *
     * @param  \App\Http\Requests\Auth\LoginRequest  $request
     * @return \Illuminate\Http\RedirectResponse
     */
Handle an incoming authentication request.
Handle an incoming authentication request .
public function store(LoginRequest $request)
    {
        $request->authenticate();
        $request->session()->regenerate();
        if(Auth::user()->type == "user")
        {
            return redirect()->route('user.index');
        }
        else
        {
            return redirect()->route('admin.index');
        }
        return redirect()->intended(RouteServiceProvider::HOME);
    }
public function store ( LoginRequest $ request ) { $ request -> authenticate ( ) ; $ request -> session ( ) -> regenerate ( ) ; if ( Auth :: user ( ) -> type == " user " ) { return redirect ( ) -> route ( 'user.index' ) ; } else { return redirect ( ) -> route ( 'admin.index' ) ; } return redirect ( ) -> intended ( RouteServiceProvider :: HOME ) ; }
Handle an incoming authentication request.
Handle an incoming authentication request .