app/Http/Controllers/Api/AuthController.php
/**
     * Get a JWT via given credentials.
     *
     * @return \Illuminate\Http\JsonResponse
     */
Get a JWT via given credentials.
Get a JWT via given credentials .
public function login(Request $request)
    {
        $credentials = $request->only(['email', 'password']);
        if (!$token = auth('api')->attempt($credentials)) {
            return response([
                'message' => 'Login ou senha incorreto!',
            ]
                , 401);
        }
        return $this->respondWithToken($token);
    }
public function login ( Request $ request ) { $ credentials = $ request -> only ( [ 'email' , 'password' ] ) ; if ( ! $ token = auth ( 'api' ) -> attempt ( $ credentials ) ) { return response ( [ 'message' => 'Login ou senha incorreto!' , ] , 401 ) ; } return $ this -> respondWithToken ( $ token ) ; }
Get a JWT via given credentials.
Get a JWT via given credentials .