Shows how to load additional table data, format column values, and display conditional values using ViewColumn
.
First, we create a custom Filament page and use it to edit the profile page. This page must extend the base Filament edit profile page.
app/Filament/Pages/EditProfile.php:
use Filament\Auth\Pages\EditProfile as BaseEditProfile; class EditProfile extends BaseEditProfile{ protected string $view = 'filament.pages.profile';}
We must enable the profile feature in the Panel Provider and provide our created EditProfile
page. We also set the page so that the simple page layout is not used.
app/Providers/Filament/AdminPanelProvider.php:
use App\Filament\Pages\EditProfile; class AdminPanelProvider extends PanelProvider{ public function panel(Panel $panel): Panel { return $panel ->default() ->id('admin') ->path('admin') ->login() ->profile(EditProfile::class, false) // ... }}
Next, we get users' experience when the page is mounted and save it in the $experiences
public property. Then, we create three actions: create, edit, and delete the job experience. The create and edit actions have the same form, so we added the form using a different method to avoid code duplication.