Manage your Sales in this Multi-Tenancy management application with Super Admin functionality
This project has two Filament panels:
The admin
panel is tenant-aware. In this case, the tenant is a Shop
, which is set in the AdminPanelProvider
.
app/Providers/Filament/AdminPanelProvider.php:
use App\Models\Store; class AdminPanelProvider extends PanelProvider{ public function panel(Panel $panel): Panel { return $panel // ... ->tenant(Store::class) ->tenantMenu(); }}
Also, the Filament\Models\Contracts\HasTenants
interface must be implemented on the User
Model when setting up multi-tenancy. If the user has access to the tenant, it is defined in the User
Model.
app/Models/User.php:
use Filament\Models\Contracts\HasTenants;use Filament\Models\Contracts\FilamentUser;use Filament\Panel; class User extends Authenticatable implements FilamentUser, HasTenants{ // ...
Next, we will: