src/Http/Middleware/Authenticate.php
/**
     * Convert an authentication exception into an unauthenticated response.
     *
     * @param  \Illuminate\Http\Request                 $request
     * @param  \Illuminate\Auth\AuthenticationException $exception
     *
     * @return \Illuminate\Http\Response
     */
Convert an authentication exception into an unauthenticated response.

@return \Illuminate\Http\Response
Convert an authentication exception into an unauthenticated response . @return \ Illuminate \ Http \ Response
protected function unauthenticated($request, AuthenticationException $exception)
    {
        if ($request->expectsJson()) {
            return response()->json(['error' => 'Unauthenticated.'], 401);
        }
        return redirect()->route('soda.login');
    }
protected function unauthenticated ( $ request , AuthenticationException $ exception ) { if ( $ request -> expectsJson ( ) ) { return response ( ) -> json ( [ 'error' => 'Unauthenticated.' ] , 401 ) ; } return redirect ( ) -> route ( 'soda.login' ) ; }
Convert an authentication exception into an unauthenticated response.
Convert an authentication exception into an unauthenticated response .