Non-static method exception on Laravel 5.1
Non-static method TymonJWTAuthJWTAuth::attempt() should not be called statically, assuming $this from incompatible context
solved in https://github.com/tymondesigns/jwt-auth/issues/104
Thanks!
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
Most helpful comment
Use this instead:
use Tymon\JWTAuth\Facades\JWTAuth;