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

Merged
merged 36 commits into from
Nov 9, 2024
Merged

Feature/tenancy #441

merged 36 commits into from
Nov 9, 2024

Conversation

bezhanSalleh
Copy link
Owner

@bezhanSalleh bezhanSalleh commented Nov 6, 2024

This pull request includes several important changes to the FilamentShield project, focusing on adding new functionalities, improving existing ones, and updating dependencies. The most crucial updates are the introduction of new traits for handling tenancy and plugin registration, updates to command functionalities, and dependency management improvements.

New Functionality:

  • Added CanGenerateRelationshipsForTenancy trait to automate the generation of relationships for tenancy support. (src/Commands/Concerns/CanGenerateRelationshipsForTenancy.php)
  • Introduced CanMakePanelTenantable trait to make panels tenantable by adding necessary middleware and plugins. (src/Commands/Concerns/CanMakePanelTenantable.php)
  • Implemented CanRegisterPlugin trait to facilitate the registration of the FilamentShield plugin. (src/Commands/Concerns/CanRegisterPlugin.php)

Command Enhancements:

  • Renamed MakeShieldGenerateCommand to GenerateCommand and added new options for tenant relationships and panel selection. (src/Commands/GenerateCommand.php) [1] [2]
  • Added CanBeProhibitable trait to prohibit commands from running in certain environments. (src/Commands/Concerns/CanBeProhibitable.php)
  • The PublishCommand now allows publishing the Shield resource for a given panel and namespaces.
  • Ensured namespace replacements for RoleResource and its associated pages.

Configuration Updates:

  • Added tenant_model configuration option to filament-shield.php. (config/filament-shield.php)

Localization Improvements:

  • Added new localization strings for team-related fields in filament-shield.php. (resources/lang/en/filament-shield.php) [1] [2]

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.

Copy link

@theoph21 theoph21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@bezhanSalleh bezhanSalleh merged commit 50e26aa into 3.x Nov 9, 2024
23 checks passed
@bezhanSalleh bezhanSalleh deleted the feature/tenancy branch November 9, 2024 21:53
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.

2 participants