jwt-auth
jwt-auth copied to clipboard
Call to undefined method Vender\Package\Auth::extend() in package
I'm trying to create an authentication package (module) using jwt-auth
that can be reused across all of my applications. But I receive errors.
Your environment
Q | A |
---|---|
Bug? | yes |
New Feature? | no |
Framework | Laravel |
Framework version | 8.46.0 |
Package version | ^1.0.0-beta.3@dev |
PHP version | 7.4.20 |
Steps to reproduce
- Create a fresh laravel project
- Create a fresh package inside it
- Add
"tymon/jwt-auth": "^1.0.0-beta.3@dev",
as requirement to thecomposer.json
of the package - Implement
JWTSubject
in yourUser
model - Try to run any artisan command.
Expected behaviour
Artisan commands work. Composer commands work.
Actual behaviour
I receive this error:
Error
Call to undefined method Vendor\Package\Auth::extend()
at vendor/tymon/jwt-auth/src/Providers/AbstractServiceProvider.php:98
94▕ * @return void
95▕ */
96▕ protected function extendAuthGuard()
97▕ {
➜ 98▕ $this->app['auth']->extend('jwt', function ($app, $name, array $config) {
99▕ $guard = new JWTGuard(
100▕ $app['tymon.jwt'],
101▕ $app['auth']->createUserProvider($config['provider']),
102▕ $app['request']
+8 vendor frames
9 [internal]:0
Illuminate\Foundation\Application::Illuminate\Foundation\{closure}()
+5 vendor frames
15 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
Update Maybe this is also relevant. My package name is Auth.
Any idea on why this happens?
Guys, you don't answer issues anymore? If that's the case please discontinue this package, or put it in the archive state so that people make more informed decisions. Our development process is halted because of this and we need to make it work. Please at least answer and tell me that you won't answer issues anymore. That gives us the certainty to take the cost of completely changing JWT.