jeffgreco13 / filament-breezy

MIT License
741 stars 131 forks source link

Installing the plugin generates an exception - breaks site #212

Closed 06tech closed 1 year ago

06tech commented 1 year ago

Installing this plugin on a v3 Filament site throws the following exception. Afterwards the site won't load anymore - throwing the same exception.


composer require jeffgreco13/filament-breezy                                                          

Info from https://repo.packagist.org: #StandWithUkraine
./composer.json has been updated
Running composer update jeffgreco13/filament-breezy
Loading composer repositories with package information
Updating dependencies
Lock file operations: 5 installs, 0 updates, 0 removals
  - Locking bacon/bacon-qr-code (2.0.8)
  - Locking dasprid/enum (1.0.4)
  - Locking jeffgreco13/filament-breezy (v2.1.5)
  - Locking paragonie/constant_time_encoding (v2.6.3)
  - Locking pragmarx/google2fa (v8.0.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 5 installs, 0 updates, 0 removals
  - Downloading jeffgreco13/filament-breezy (v2.1.5)
  - Installing dasprid/enum (1.0.4): Extracting archive
  - Installing paragonie/constant_time_encoding (v2.6.3): Extracting archive
  - Installing pragmarx/google2fa (v8.0.1): Extracting archive
  - Installing bacon/bacon-qr-code (2.0.8): Extracting archive
  - Installing jeffgreco13/filament-breezy (v2.1.5): Extracting archive
1 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   Exception

  Plugin [filament-breezy] is not registered for panel [admin].

  at vendor/filament/filament/src/Panel/Concerns/HasPlugins.php:45
     41▕     }
     42▕
     43▕     public function getPlugin(string $id): Plugin
     44▕     {
  ➜  45▕         return $this->getPlugins()[$id] ?? throw new Exception("Plugin [{$id}] is not registered for panel [{$this->getId()}].");
     46▕     }
     47▕
     48▕     public function hasPlugin(string $id): bool
     49▕     {

      +20 vendor frames

  21  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}(Object(Jeffgreco13\FilamentBreezy\FilamentBreezyServiceProvider))
      +5 vendor frames

  27  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

```Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
papipsycho commented 1 year ago

I got the same issue

jeffgreco13 commented 1 year ago

@06tech @papipsycho what version of Filament are you using?

papipsycho commented 1 year ago

Version v3.0.27

jeffgreco13 commented 1 year ago

Did you add BreezyCore::make() to your AdminServiceProvider before it was installed? It would appear that Filament is trying to read a plugin that hasn't been installed/discovered yet.

papipsycho commented 1 year ago

Btw i downgrade to the version 2.1.4 of breezy and seem better

papipsycho commented 1 year ago

Did you add BreezyCore::make() to your AdminServiceProvider before it was installed? It would appear that Filament is trying to read a plugin that hasn't been installed/discovered yet.

Nop, i was thinking to do that after the composer require / install

rich06 commented 1 year ago

v3.0.27

papipsycho commented 1 year ago

Ok so the issue, seems come from the version 2.1.5, cause with 2.1.4 is work like a charme

jeffgreco13 commented 1 year ago

What happens when you try composer update? There's nothing in v2.1.5 that would prevent the package from being discovered.

rich06 commented 1 year ago

Did you add BreezyCore::make() to your AdminServiceProvider before it was installed? It would appear that Filament is trying to read a plugin that hasn't been installed/discovered yet.

Nop, i was thinking to do that after the composer require / install

Same goes for me - the Breezy install is supposed to happen after the composer require right? Exception seems to be coming from your routes/web.php

papipsycho commented 1 year ago

I checked the diff between the 2.1.5 and 2.1.4 and i really didn't understood why we got this issue,

here the video of installer 2.1.5 vs 2.1.4

papipsycho commented 1 year ago

I forget the url : https://youtu.be/-BcYq4Vni0g

rich06 commented 1 year ago

I checked the diff between the 2.1.5 and 2.1.4 and i really didn't understood why we got this issue,

here the video of installer 2.1.5 vs 2.1.4

It looks like the Breezy routes/web.php is getting loaded/called by Laravel or Filament before the plugin has been installed and the Breezy route is calling one of it's own plugin functions .. so as it hasn't been installed -> Exception... or something like that...

jeffgreco13 commented 1 year ago

Can you both try composer update now?

06tech commented 1 year ago

yea for me composer require jeffgreco13/filament-breezy - completes now with no exception anymore. Thanks for the quick resolution.