F
Filament3mo ago
Nicole

Display Tenant Profile Page

I created a custom profile page for multi-tenancy. Could you please advise me on how to display it like the image I attached? #multi-tenancy
No description
6 Replies
Nicole
NicoleOP3mo ago
Here is my code
<?php

namespace App\Filament\Pages\Team;

use App\Models\User;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Pages\Tenancy\EditTenantProfile;
use Filament\Tables\Actions\Action;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;
use Filament\Tables\Table;

class Profile extends EditTenantProfile implements HasTable
{
use InteractsWithTable;

protected static string $view = 'filament.pages.team.profile';

public static function getLabel(): string
{
return 'Team profile';
}

public function form(Form $form): Form
{
return $form
->schema([
Section::make('Team Name')
->aside()
->schema([
TextInput::make('name')
->label('Name')
->required(),
]),
]);
}

public function table(Table $table): Table
{
return $table
->query(User::query())
->columns([
TextColumn::make('name'),
])
->filters([
// ...
])
->actions([
// ...
])
->bulkActions([
// ...
])
->headerActions([
Action::make('create')
->label('create user')
->modal('createUser'),
]);
}
}
<?php

namespace App\Filament\Pages\Team;

use App\Models\User;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Pages\Tenancy\EditTenantProfile;
use Filament\Tables\Actions\Action;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;
use Filament\Tables\Table;

class Profile extends EditTenantProfile implements HasTable
{
use InteractsWithTable;

protected static string $view = 'filament.pages.team.profile';

public static function getLabel(): string
{
return 'Team profile';
}

public function form(Form $form): Form
{
return $form
->schema([
Section::make('Team Name')
->aside()
->schema([
TextInput::make('name')
->label('Name')
->required(),
]),
]);
}

public function table(Table $table): Table
{
return $table
->query(User::query())
->columns([
TextColumn::make('name'),
])
->filters([
// ...
])
->actions([
// ...
])
->bulkActions([
// ...
])
->headerActions([
Action::make('create')
->label('create user')
->modal('createUser'),
]);
}
}
#profile.blade.php
<x-filament-panels::page>

</x-filament-panels::page>
<x-filament-panels::page>

</x-filament-panels::page>
neverything
neverything3mo ago
Hey, what seems to be missing?
Nicole
NicoleOP3mo ago
The page is blank
neverything
neverything3mo ago
Did you add it to your panel provider? I have ->tenantProfile(EditProjectProfile::class) with EditProjectProfile being my tenant profile page. And my blade template looks like this:
<x-filament-panels::page>
<x-filament-panels::form id="form" wire:submit="save">
{{ $this->form }}

<x-filament-panels::form.actions
:actions="$this->getCachedFormActions()"
:full-width="$this->hasFullWidthFormActions()"
/>
</x-filament-panels::form>
</x-filament-panels::page>
<x-filament-panels::page>
<x-filament-panels::form id="form" wire:submit="save">
{{ $this->form }}

<x-filament-panels::form.actions
:actions="$this->getCachedFormActions()"
:full-width="$this->hasFullWidthFormActions()"
/>
</x-filament-panels::form>
</x-filament-panels::page>
Nicole
NicoleOP3mo ago
It works. Thank you! By the way, how about the table?
Tahin
Tahin3mo ago
{{ $this->table }} <div> {{ $this->table }} </div>
Want results from more Discord servers?
Add your server