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

[Bug]: Class "Filament\Plugin\ModulesPlugin" not found #117

Open
bacipher opened this issue Nov 15, 2024 · 4 comments
Open

[Bug]: Class "Filament\Plugin\ModulesPlugin" not found #117

bacipher opened this issue Nov 15, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@bacipher
Copy link

bacipher commented Nov 15, 2024

What happened?

When performing a dump-autoload and have already registered the pluggin in your panel. When you try to do a install the plugin with: php artisan module:filament:install MyModule, you get this error.

How to reproduce the bug

Add the package and configure

composer require coolsam/modules

php artisan vendor:publish --tag="modules-config"

Register the plugin

// e.g. in App\Providers\Filament\AdminPanelProvider.php
 
use Filament\Plugin\ModulesPlugin;
public function panel(Panel $panel): Panel
{
    return $panel
        ...
        ->plugin(ModulesPlugin::make());
}

Create a Module

php artisan module:make MyModule

Install the Module

php artisan module:filament:install MyModule

Package Version

4.0

PHP Version

8.0

Laravel Version

11.9

Which operating systems does with happen with?

Linux

Notes

Suggested Solution

When registering the plugin in your panel, one should use the package namespace rather than filament namespace

// e.g. in App\Providers\Filament\AdminPanelProvider.php
 
use Coolsam\Modules\ModulesPlugin;
public function panel(Panel $panel): Panel
{
    return $panel
        ...
        ->plugin(ModulesPlugin::make());
}

@bacipher bacipher added the bug Something isn't working label Nov 15, 2024
@rezwanul7
Copy link

@bacipher I was facing the same issue. Upon investigation I have found that I was using "coolsam/modules": "4" in my composer.json. I updated it to "coolsam/modules": "^v4.0.6". And it works.

@taghassan
Copy link

try

use Coolsam\Modules\ModulesPlugin;

@bacipher
Copy link
Author

bacipher commented Jan 8, 2025

try

use Coolsam\Modules\ModulesPlugin;

This is what I used. I was pointing out an issue and giving a solution at the same time :)

@bacipher
Copy link
Author

bacipher commented Jan 8, 2025

@bacipher I was facing the same issue. Upon investigation I have found that I was using "coolsam/modules": "4" in my composer.json. I updated it to "coolsam/modules": "^v4.0.6". And it works.

Will try this and see if it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants