概要
デフォルトのボタンの大きさはこんな感じになってますよね。
ドキュメント曰く->size('lg')
メソッドでアクションボタンの大きさを変更するらしいですが
作成ボタンのアクションは継承元のCreateRecord
クラスのgetCreateFormAction
で定義されてるのでオーバーライドして追記します。
app/Filament/Resources/StoreResource/Pages/CreateStore.php
class CreateStore extends CreateRecord
{
protected static string $resource = StoreResource::class;
protected function getCreateFormAction(): Action
{
return Action::make('create')
->label(__('Create'))
->submit('create')
->keyBindings(['mod+s'])
->size('lg');
}
}
はいでかくなりました。
一覧ページの「作成」ボタンをでかくする
アクションを生成している処理があるのでsize()
を付け足します
app/Filament/Resources/StoreResource/Pages/ListStores.php
class ListStores extends ListRecords
{
protected static string $resource = StoreResource::class;
protected function getActions(): array
{
return [
Actions\CreateAction::make()->size('lg'),
];
}