© 2026 Hedgehog Software, LLC
public static function configure(Schema $schema): Schema { return $schema ->components([ Hidden::make('editor_id') ->default(auth()->id()), TextInput::make('title') ->label(__('Title')) ->required() ->maxLength(255), DateTimePicker::make('published_at') ->label(__('Published at')) ->displayFormat('d.m.Y, H:i') ->native(false) ->seconds(false) ->nullable(), RichEditor::make('body') ->label(__('Body')) ->columnSpan('full'), Toggle::make('is_active') ->label(__('Active')) ->default(true), ]); }
General error: 1364 Field 'body' doesn't have a default value (Connection: mysql, SQL: insert into `announcements` (`editor_id`, `title`, `published_at`, `is_active`, `updated_at`, `created_at`) values (1, zuguz, ?, 1, 2025-09-25 17:31:35, 2025-09-25 17:31:35))
Using SpatieMediaLibraryFileAttachmentProvider requires that the rich content attribute (content in this example) must be defined as nullable in database.