ryangjchandler / filament-navigation

Build structured navigation menus in Filament.
MIT License
168 stars 64 forks source link

Move item form schema into separate method #99

Open howdu opened 1 year ago

howdu commented 1 year ago

Allow for easier overwriting of the item form schema.

E.g I needed to remove the required from the label due to it being fetched from elsewhere.

class CreateNavigation extends \RyanChandler\FilamentNavigation\Filament\Resources\NavigationResource\Pages\CreateNavigation
{
    protected static function getItemFormSchema(): array
    {
        return [
            TextInput::make('label')
                ->label(__('filament-navigation::filament-navigation.items-modal.label')),
            //...
        ];
    }
}