schema([ TextInput::make('title') ->label('Title') ->required() ->maxLength(255) ->placeholder('Welcome to Our Platform'), MarkdownEditor::make('description') ->label('Description') ->required() ->placeholder('A brief description of this onboarding step...') ->helperText('You can use markdown formatting in the description. Use **bold**, *italic*, links, lists, and more.'), FileUpload::make('image') ->label('Image') ->image() ->disk('public') ->directory('onboarding') ->visibility('public') ->imageEditor() ->imageEditorAspectRatios([ '16:9', '4:3', '1:1', ]) ->maxSize(2048) ->helperText('Upload an image for this slide (max 2MB). Recommended aspect ratio: 16:9'), TextInput::make('sort') ->label('Sort Order') ->numeric() ->default(0) ->required() ->helperText('Lower numbers appear first'), Toggle::make('enabled') ->label('Enabled') ->default(true) ->helperText('Only enabled slides will be shown to users'), Toggle::make('is_guided') ->label('Guided Slide') ->default(false) ->helperText('If enabled, this slide will redirect the user to a specific page') ->live(), Select::make('page_route') ->label('Page to Guide To') ->options([ 'dashboard' => 'Dashboard', 'services' => 'Services', 'services.first' => 'First Active Service', 'invoices' => 'Invoices', 'tickets' => 'Tickets', 'tickets.create' => 'Create Ticket', 'account' => 'Account Settings', 'account.security' => 'Account Security', 'account.payment-methods' => 'Payment Methods', 'account.notifications' => 'Notifications', 'products' => 'Browse Products', ]) ->helperText('Select which page the user should be guided to') ->visible(fn (Get $get): bool => $get('is_guided')) ->required(fn (Get $get): bool => $get('is_guided')), ]) ->columns(1); } public static function table(Table $table): Table { return $table ->columns([ ImageColumn::make('image') ->label('Image') ->disk('public') ->square() ->defaultImageUrl(url('/images/placeholder.png')), TextColumn::make('title') ->label('Title') ->searchable() ->sortable() ->limit(50), TextColumn::make('description') ->label('Description') ->limit(80) ->wrap(), TextColumn::make('sort') ->label('Order') ->sortable() ->alignCenter(), ToggleColumn::make('enabled') ->label('Enabled') ->alignCenter(), TextColumn::make('is_guided') ->label('Guided') ->badge() ->color(fn (bool $state): string => $state ? 'success' : 'gray') ->formatStateUsing(fn (bool $state): string => $state ? 'Yes' : 'No') ->alignCenter(), TextColumn::make('created_at') ->label('Created') ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) ->defaultSort('sort', 'asc') ->reorderable('sort'); } public static function getPages(): array { return [ 'index' => ListOnboardingSlides::route('/'), 'create' => CreateOnboardingSlide::route('/create'), 'edit' => EditOnboardingSlide::route('/{record}/edit'), ]; } }