๐ŸŽ‡Use Accounts as SaaS Panel

Install Jetstream without installing it.

composer require laravel/jetstream

then publish the migrations

php artisan vendor:publish --tag=filament-accounts-teams-migrations

now you need to migrate your database

php artisan migrate

now publish your Accounts model

php artisan vendor:publish --tag="filament-accounts-model"

inside your published model use this implementation

class Account extends Authenticatable implements HasMedia, FilamentUser, HasAvatar, HasTenants, HasDefaultTenant
{
    ...
    use InteractsWithTenant;
}

on your main panel, you must use teams

->plugin(\TomatoPHP\FilamentAccounts\FilamentAccountsPlugin::make()
        ...
        ->canLogin()
        ->canBlocked()
        ->useTeams()
)

now on your new panel just use this plugin

->plugin(
    FilamentAccountsSaaSPlugin::make()
        ->databaseNotifications()
        ->checkAccountStatusInLogin()
        ->APITokenManager()
        ->editTeam()
        ->deleteTeam()
        ->teamInvitation()
        ->showTeamMembers()
        ->editProfile()
        ->editPassword()
        ->browserSesstionManager()
        ->deleteAccount()
        ->editProfileMenu()
        ->registration()
        ->useOTPActivation(),
)

you can change settings by removing just methods from the plugin.

Last updated