Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to undefined method Vender\Package\Auth::extend() in package #2129

Open
Nefcanto opened this issue Jun 11, 2021 · 2 comments
Open

Call to undefined method Vender\Package\Auth::extend() in package #2129

Nefcanto opened this issue Jun 11, 2021 · 2 comments

Comments

@Nefcanto
Copy link

Nefcanto commented Jun 11, 2021

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

  1. Create a fresh laravel project
  2. Create a fresh package inside it
  3. Add "tymon/jwt-auth": "^1.0.0-beta.3@dev", as requirement to the composer.json of the package
  4. Implement JWTSubject in your User model
  5. 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.

@Nefcanto
Copy link
Author

Any idea on why this happens?

@Nefcanto
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant