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 Stevebauman\Purify\Purify::getPurifier() #80

Closed
jwittekind opened this issue Dec 17, 2023 · 9 comments
Closed

Comments

@jwittekind
Copy link

Hey there!

I'm currently updating my Laravel Application using Laravel 8 and PHP 7.4.

I just tried to follow you steps for migrating v4 to v5.
Before that i've been working with v3 so far.

After execution of the package update:

composer require stevebauman/purify:^5.0 --with-all-dependencies

I now see this error:

✗ php artisan vendor:publish --provider="Stevebauman\Purify\PurifyServiceProvider"

   Error 

  Call to undefined method Stevebauman\Purify\Purify::getPurifier()

  at vendor/laravel/framework/src/Illuminate/Support/Manager.php:191
    187▕      * @return mixed
    188▕      */
    189▕     public function __call($method, $parameters)
    190▕     {
  ➜ 191▕         return $this->driver()->$method(...$parameters);
    192▕     }
    193▕ }
    194▕ 

      +1 vendor frames 
  2   app/Providers/PurifyServiceProvider.php:27
      Illuminate\Support\Facades\Facade::__callStatic("getPurifier", [])

      +7 vendor frames 
  10  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}(Object(App\Providers\PurifyServiceProvider))

Any idea where this could come from?

Thanks in advance!

@michele
Copy link

michele commented Jan 11, 2024

I'm experiencing the same? did you manage to fix it?

@stevebauman
Copy link
Owner

Hi guys, sorry for the late reply.

Can you post your full stack traces? I can't really see where the method call is coming from, so it could be from your application, or it could be from Purify, but I'm unable to tell.

Thanks!

@michele
Copy link

michele commented Jan 11, 2024

I had to remove this:

App\Providers\PurifySetupProvider::class

from the providers in config/app.php.

Now, it works.

@jwittekind
Copy link
Author

jwittekind commented Jan 11, 2024

Oh! Interesting. Did i miss that step when migrating? Not sure whether i should have seen any migration docs.
I'll check, whether that fixes my issue too!

@michele
Copy link

michele commented Jan 11, 2024

In the installation instruction for v4, it says to add it, but in the migration guide from v4 to v5 it doesn't say to remove it

@stevebauman
Copy link
Owner

@michele Are you using Lumen? Manual service provider registration was only intended for Lumen. Purify has always auto-loaded its service provider for Laravel:

If you are using Lumen, you should copy the config file purify.php by hand, and add this line to your bootstrap/app.php:

$app->register(Stevebauman\Purify\PurifyServiceProvider::class);

@stevebauman
Copy link
Owner

Closing due to inactivity. Let me know if you still need assistance and I'll re-open this 👍

@michele
Copy link

michele commented Jan 18, 2024

No need to re-open. I inherited this codebase, so not sure why they added it since we're not using Lumen, sorry I didn't get back to you earlier.

@stevebauman
Copy link
Owner

Ok thanks for reporting back! Appreciate it 🙏

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

3 participants