Skip to content

Latest commit

 

History

History
128 lines (83 loc) · 4.01 KB

File metadata and controls

128 lines (83 loc) · 4.01 KB

Upgrade Guide

Upgrading from FilamentCompanies 4.x to 5.x

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.

Breaking Changes

Company features now require explicit configuration:

Before (4.x):

FilamentCompanies::make()
    ->companies(invitations: true)  // This enabled all company features

After (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 deletion

This change provides better security through the principle of least privilege and clearer understanding of which features are active in your application.

Upgrading from FilamentCompanies 3.x to 4.x

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.

Breaking Changes

  1. Removal of Classes:

    • Wallo\FilamentCompanies\Features
    • Wallo\FilamentCompanies\Providers
    • Wallo\FilamentCompanies\Socialite
  2. Introduction of Enums:

    • Functionality previously available through the Providers class has been replaced by the Wallo\FilamentCompanies\Enums\Provider enum.
    • Some functionality previously available through the Socialite class has been replaced by the Wallo\FilamentCompanies\Enums\Feature enum.
  3. Removal of the MakeUserCommand command.

    • It isn't necessary and was removed to simplify the package.

Migration Steps

Dependency Versions

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

Socialite Providers

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...

Socialite Features

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...

Important Notes

The rest of the methods previously available in the Socialite and Features classes are still available and were moved to the main Wallo\FilamentCompanies\FilamentCompanies class.

Further Assistance

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.