schema([ Section::make('Review Form') ->schema([ TextInput::make('name'), TextInput::make('location'), FileUpload::make('image')->image()->imageCropAspectRatio('1:1') ->downloadable()->directory('review') ->getUploadedFileNameForStorageUsing(function (TemporaryUploadedFile $file): string { return (string) str($file->getClientOriginalName())->prepend(now()->timestamp); }), Select::make('rating')->placeholder('Choose Rating Star out of Five') ->options([ '1' =>'1', '2' =>'2', '3' =>'3', '4' =>'4', '5' =>'5', ])->searchable(), Grid::make(1) ->schema([ Textarea::make('message'), ]) ])->columns(2) ]); } public static function table(Table $table): Table { return $table ->columns([ TextColumn::make('name')->searchable(), ImageColumn::make('image'), TextColumn::make('rating'), TextColumn::make('message')->limit(60), ]) ->filters([ // Tables\Filters\TrashedFilter::make(), ]) ->actions([ Tables\Actions\EditAction::make(), ]) ->emptyStateActions([ Tables\Actions\CreateAction::make(), ]); } public static function getRelations(): array { return [ // ]; } public static function getPages(): array { return [ 'index' => Pages\ListReviews::route('/'), 'create' => Pages\CreateReview::route('/create'), 'edit' => Pages\EditReview::route('/{record}/edit'), ]; } public static function getEloquentQuery(): Builder { return parent::getEloquentQuery() ->withoutGlobalScopes([ SoftDeletingScope::class, ]); } }