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

Critical Errors in Latest Version of Filament Shield with Multi-Tenancy #487

Open
abdulmejidshemsuawel opened this issue Jan 19, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@abdulmejidshemsuawel
Copy link

The latest version of Filament Shield has significant issues when executing commands in a multi-tenancy setup. The following problems were encountered:

  • Command & File Generation Issues: php artisan shield:setup --tenant=App\Models\Team & php artisan shield:install admin
    • The respective files are being rewritten incorrectly:
      • Code is appended to the end of the file instead of being properly inserted or generated.
      • Incorrectly appends code to the AppServiceProvider.
      • Files such as filament-shield and permissions configuration files are not being created or published as expected.
      • Wrongly appends code to the respective panel's provider file, e.g., AdminPanelProvider.

Steps to Reproduce:

  1. Run php artisan shield:setup --tenant=App\Models\Team in a multi-tenant application.
  2. Observe how the generated files are appended incorrectly or not created.
  3. Run php artisan shield:install admin and notice the issues in AppServiceProvider and AdminPanelProvider.

Expected Behavior:

  • Code should be inserted and structured correctly.
  • Publishable configuration files should be generated (filament-shield, permissions, etc.).
  • The commands should work seamlessly in a multi-tenant setup without breaking existing functionality.

Environment:

  • PHP Version: 8.2.7
  • Laravel Version: 11.31
  • Filament Shield Version: 3.2
  • Filament Shield Version: 3.3.4

These issues appear to have been introduced with the new multi-tenancy feature in the latest version.

@abdulmejidshemsuawel abdulmejidshemsuawel added the bug Something isn't working label Jan 19, 2025
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

2 participants