Version 5.x introduces more granular control over company features. Previously, enabling companies() would automatically enable all company management features. Now you must explicitly enable each feature you want to use.
Company features now require explicit configuration:
Before (4.x):
FilamentCompanies::make()
->companies(invitations: true) // This enabled all company featuresAfter (5.x):
FilamentCompanies::make()
->companies(invitations: true) // Only enables basic company support
->updateCompanyInformation() // Explicitly enable company name updates
->manageCompanyEmployees() // Explicitly enable employee management
->companyDeletion() // Explicitly enable company deletionThis change provides better security through the principle of least privilege and clearer understanding of which features are active in your application.
This major release introduces significant changes designed to streamline the usage of FilamentCompanies. Here’s how to migrate your project from 3.x to 4.x.
-
Removal of Classes:
Wallo\FilamentCompanies\FeaturesWallo\FilamentCompanies\ProvidersWallo\FilamentCompanies\Socialite
-
Introduction of Enums:
- Functionality previously available through the
Providersclass has been replaced by theWallo\FilamentCompanies\Enums\Providerenum. - Some functionality previously available through the
Socialiteclass has been replaced by theWallo\FilamentCompanies\Enums\Featureenum.
- Functionality previously available through the
-
Removal of the
MakeUserCommandcommand.- It isn't necessary and was removed to simplify the package.
You should first make sure you follow the Laravel 11 Upgrade Guide and then upgrade your andrewdwallo/filament-companies dependency to ^4.0 within your application's composer.json file. Then, run the composer update command:
composer update
For Socialite providers, replace the usage of the Wallo\FilamentCompanies\Providers class with the Wallo\FilamentCompanies\Enums\Provider enum.
Before:
use Wallo\FilamentCompanies\Providers;
// Enable the following Socialite providers.
Providers::github(),
// And so on for the other providers...
// Determine if the following Socialite providers are enabled.
Providers::hasGithub(),
// And so on for the other providers...After:
use Wallo\FilamentCompanies\Enums\Provider;
// Enable the following Socialite providers.
Provider::Github,
// And so on for the other providers...
// Determine if the following Socialite providers are enabled.
Provider::Github->isEnabled(),
// And so on for the other providers...For Socialite features, replace the usage of the Wallo\FilamentCompanies\Socialite class with the Wallo\FilamentCompanies\Enums\Feature enum.
Before:
use Wallo\FilamentCompanies\Socialite;
// Enable the following features.
Socialite::rememberSession(),
// And so on for the other features...
// Determine if the following features are enabled.
Socialite::hasRememberSessionFeature(),
// And so on for the other features...After:
use Wallo\FilamentCompanies\Enums\Feature;
// Enable the following features.
Feature::RememberSession,
// And so on for the other features...
// Determine if the following features are enabled.
Feature::RememberSession->isEnabled(),
// And so on for the other features...The rest of the methods previously available in the
SocialiteandFeaturesclasses are still available and were moved to the mainWallo\FilamentCompanies\FilamentCompaniesclass.
Should you encounter any issues during the upgrade process, please don’t hesitate to reach out Discord or by creating a new Discussion on GitHub.