savannabits / filament-modules

Integration of Filament with nWidart/laravel-modules: Create independent Filament Files for each Laravel Module
https://filamentphp.com/plugins/coolsam-modules
MIT License
109 stars 22 forks source link

[Bug]: In a multi panel app it doesn't create resources inside the panel namespace. #109

Closed rezwanul7 closed 4 months ago

rezwanul7 commented 4 months ago

What happened?

In a multipanel app when running php artisan module:make:filament-resource asks about the panel. But it doesn't generate the resources inside the folder belonging to the panel.

How to reproduce the bug

Create a multipanel app i.e. org, team. Run php artisan module:make:filament-resource. It will ask about the panel and select org.

Package Version

4.0.6

PHP Version

8.2.0

Laravel Version

11.15.0

Which operating systems does with happen with?

Windows

Notes

No response

coolsam726 commented 4 months ago

Hi @rezwanul7, I have tried to reproduce your issue above but I couldn't. I have created a bare minimum setup by following the package's documentation and it works perfectly. I followed these steps:

  1. Created a new Laravel Project

  2. Ran composer to install coolsam/modules, which by default installs all the other dependencies including filament and nwidart/laravel-modules.

  3. Configured Filament (filament:install) and created two Panels: Org and Team

  4. Opened the Org Panel and added the ModulesPlugin there (My highest suspicion is that you may have skipped this). Here is how my Org panel looks like: image

  5. Configured nwidart/modules as per the documentation, including adding the folllowing to composer.json: image

  6. Created a new Module called Procurement: php artisan module:make Procurement

  7. Added a new model called Supplier to the Procurement module with a factory, seeder and migration: php artisan module:make-model Supplier -mfs Procurement image

  8. Installed the Filament Modules Plugin under the Procurement Module: php artisan module:filament:install. Here are my steps: image

  9. Finally generated a Suppliers Resource under the Procurement module, after running php artisan migrate. Here are my steps: image

After going through the above steps, here is my working app: image

Feel free share your reproduction repo in case you are still experiencing challenges. Closing this for now.

coolsam726 commented 4 months ago

What happened?

In a multipanel app when running php artisan module:make:filament-resource asks about the panel. But it doesn't generate the resources inside the folder belonging to the panel.

How to reproduce the bug

Create a multipanel app i.e. org, team. Run php artisan module:make:filament-resource. It will ask about the panel and select org.

Package Version

4.0.6

PHP Version

8.2.0

Laravel Version

11.15.0

Which operating systems does with happen with?

Windows

Notes

No response

Just to clarify, the whole idea of using this package is to gain autonomy from the main app/ directory, so resources are not generated in the panel folder, they are rather generated inside the Module of your choice. Here is a sample directory structure for a Procurement module registered under the Org panel: image