Jwt-auth: Non-static method Tymon\JWTAuth\JWTAuth::attempt()

Created on 14 Jul 2015  路  9Comments  路  Source: tymondesigns/jwt-auth

Non-static method exception on Laravel 5.1

Non-static method TymonJWTAuthJWTAuth::attempt() should not be called statically, assuming $this from incompatible context

Most helpful comment

Use this instead:

use Tymon\JWTAuth\Facades\JWTAuth;

All 9 comments

What was the solution to this? I'm getting the same error!

@GlenHughes are you using

use Tymon\JWTAuth\JWTAuth;

in your class? I believe this overrides the facade JWTAuth and does not allow static calls

Use this instead:

use Tymon\JWTAuth\Facades\JWTAuth;

Not found class with IlluminateSupportFacadesAuth

please instead configjwt..php : 'jwt' => 'Tymon\JWTAuth\Providers\JWT\NamshiAdapter', as 'jwt' => Tymon\JWTAuth\Providers\JWT\Namshi::class , 'auth' => 'Tymon\JWTAuth\Providers\Auth\IlluminateAuthAdapter' as 'auth' => Tymon\JWTAuth\Providers\Auth\Illuminate::class , 'storage' => 'Tymon\JWTAuth\Providers\Storage\IlluminateCacheAdapter' as 'storage' => Tymon\JWTAuth\Providers\Storage\Illuminate::class

use TymonJWTAuthFacadesJWTAuth;

If I use "use TymonJWTAuthFacadesJWTAuth; I get "message": "Class 'Tymon\JWTAuth\facades\JWTAuth' not found",
& in case of use TymonJWTAuthJWTAuth; i get Non-static method Tymon\JWTAuth\JWT::parseToken() should not be called statically"

use Tymon\JWTAuth\Facades\JWTAuth as JWTAuth;

try

JWTAuth::attempt($credentials) or any function comes with JWTAuth

this will remove the error

Was this page helpful?
0 / 5 - 0 ratings

Related issues

agneshoving picture agneshoving  路  3Comments

heroghost picture heroghost  路  3Comments

kofi1995 picture kofi1995  路  3Comments

hfalucas picture hfalucas  路  3Comments

johncloud200 picture johncloud200  路  3Comments