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

Feature/tenancy #441

Open
wants to merge 23 commits into
base: 3.x
Choose a base branch
from
Open

Feature/tenancy #441

wants to merge 23 commits into from

Conversation

bezhanSalleh
Copy link
Owner

@bezhanSalleh bezhanSalleh commented Nov 6, 2024

This pull request includes significant updates to the FilamentShield package, introducing new functionalities and improvements to the codebase. The most important changes involve adding new traits for handling tenancy and command prohibitions, updating configuration options, and enhancing the language files.

New Traits for Handling Tenancy and Command Prohibitions:

  • Added CanGenerateRelationshipsForTenancy trait to handle the generation of relationships for tenancy. This includes methods for generating relationships, guessing relationship types, and adding model return type import statements.
  • Added CanMakePanelTenantable trait to make a panel tenantable by setting up tenancy and activating tenancy middleware.
  • Added CanBeProhibitable trait to prohibit commands from running in certain environments, displaying a warning if attempted.

Configuration and Language File Updates:

  • Updated config/filament-shield.php to include a new tenant_model configuration option.
  • Enhanced language files (resources/lang/en/filament-shield.php) by adding translations for team fields and updating the select_all message. [1] [2]

Codebase Enhancements:

  • Renamed MakeShieldGenerateCommand to GenerateCommand and included new options for panel selection and command prohibition. [1] [2] [3]
  • Updated composer.json to add new dependencies and reorder existing ones.

These changes collectively enhance the functionality, configurability, and maintainability of the FilamentShield package.

Copy link

what-the-diff bot commented Nov 6, 2024

PR Summary

  • Update on PHPUnit cache and PHPStan configuration
    The PHPUnit cache has been updated to a newer version offering better speed and efficiency. Couple with this, the PHPStan configuration has been enhanced to give more precise results.

  • TODO file and language enhancements
    A new 'TODO' file is added to give a clear list of tasks ahead. The language entries have also been updated to help understand functionalities better.

  • Introduction of new traits and configuration options
    New traits and configuration options have been added to improve functionality around tenant relationships, panel tenancy, and file management.

  • Registration and command class enhancements
    The process of registering the shield plugin has been simplified with a new trait. Additionally, the 'InstallCommand' class has been improved to better configure the shield for tenant management.

  • Extensions to team role support
    There's enhanced support for assigning roles to teams with the introduction of a new '--team' option to the 'MakeShieldSuperAdminCommand' class.

  • Renamed Command Class
    The 'MakeShieldInstallCommand' class is now 'SetupCommand', featuring updates focusing on installation tasks.

  • Integration of new middleware and trait
    The 'SyncShieldTenant' middleware has been integrated to handle tenant synchronization. Also, a trait has been added to facilitate better handling of the central app and tenant model.

  • Addition of Role and Permission Models
    New 'Role' and 'Permission' classes allow for more customization within the system.

  • Enhancements to RoleResource and SetupCommand
    The 'RoleResource' class allows forms to handle a 'team_id', and changes visibility depending on the central app status. Additionally, the 'SetupCommand' class is now better suited to handle tenant models and permissions configuration.

  • Improved AppServiceProvider Configuration
    The registration process of custom 'Role' and 'Permission' classes in the AppServiceProvider has been improved.

  • Permission and Role Handling Updates
    The process for form data mutation in the 'CreateRole' and 'EditRole' pages has been adjusted to include handling of 'team_id'.

  • Utils Method Addition
    A new method has been introduced to check if team-based features are enabled in the permission configuration.

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

Successfully merging this pull request may close these issues.

1 participant