Is this best practise?

Hi, i'm trying out something new and don't have much experience with Filament. I'm trying to follow best practises and wonder whether i'm doing the following right? Will i encounter problems ? I have a resource called 'EmailAccountResource' and removed the 'createRecord' action to replace it with a custom page where Office365 accounts can be connected and added to the model. So i created a custom page where i can generate a URL and add it to a custom action like this:
class ListEmailAccounts extends ListRecords
{
protected static string $resource = EmailAccountResource::class;

protected function getHeaderActions(): array
{
return [
Action::make('Add Email')
->url(ConnectEmailAccount::getUrl()),
];
}
}
class ListEmailAccounts extends ListRecords
{
protected static string $resource = EmailAccountResource::class;

protected function getHeaderActions(): array
{
return [
Action::make('Add Email')
->url(ConnectEmailAccount::getUrl()),
];
}
}
and
class ConnectEmailAccount extends Page
{
protected static string $resource = EmailAccountResource::class;

protected static string $view = 'filamentPdashboard.resources.email-account-resource.pages.connect-email-account';
}
class ConnectEmailAccount extends Page
{
protected static string $resource = EmailAccountResource::class;

protected static string $view = 'filamentPdashboard.resources.email-account-resource.pages.connect-email-account';
}
Or am i supposed to create a custom action like a 'create' action exists and handle these kind of things there? So basically, when do i create a custom page and when do i create custom actions?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server