Jwt-auth: Exception with php artisan jwt:generate

Created on 13 Feb 2018  路  4Comments  路  Source: tymondesigns/jwt-auth

Exception while generating the secret key

While executing the command php artisan jwt:generate an exception has been thrown that method handle doesn't exist in JWTGenerateCommand class
Method Tymon\JWTAuth\Commands\JWTGenerateCommand::handle() does not exist.

The solution was to change the name of the method "fire" in the same class to "handle" and it worked just fine.

Your environment

| Q | A
| ----------------- | ---
| Bug? | yes
| Framework | Laravel
| Framework version | 5.5.34
| Package version | ^0.5.12
| PHP version | 7.0.25

Steps to reproduce

install the package and try to generate the secret.

Expected behaviour

Generating the secret code

Actual behaviour

Throw an exception

Most helpful comment

Laravel 5.5 renamed the fire function to handle. A temporary rename in the vendor folder made this work, but perhaps a PR is in order that checks the laravel version and uses the appropriate function.

All 4 comments

Hi, I can confirm this error. Having the same issue then running php artisan jwt:generate

@psychonetic @mohamed-atef with laravel 5.5 you use the command php artisan jwt:secret

and better use version 1.0.0 of this package

@nivanmorgan I thought I had version 1.0* installed, but when installing it like provided in the new documentation composer require tymon/jwt-auth it still installs the old version (yeah, I know it's an unfinished documetation, but writing such basic things does not take a whole day).

And yes when using version 1.0.0-rc2 php artisan jwt:secret works as expected. Thank you!

Laravel 5.5 renamed the fire function to handle. A temporary rename in the vendor folder made this work, but perhaps a PR is in order that checks the laravel version and uses the appropriate function.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

therealmjk picture therealmjk  路  3Comments

lloy0076 picture lloy0076  路  3Comments

CBR09 picture CBR09  路  3Comments

harveyslash picture harveyslash  路  3Comments

phamduong picture phamduong  路  3Comments