From 4b968fcb931779d139c12f36e99e79fbfc2521f7 Mon Sep 17 00:00:00 2001 From: Lupu Gheorghe Date: Mon, 18 Nov 2024 08:23:22 +0200 Subject: [PATCH] add images --- .../Resources/PointResource/Pages/ViewMapPoint.php | 12 ++++++++++++ lang/ro/map_points.php | 1 + 2 files changed, 13 insertions(+) diff --git a/app/Filament/Resources/PointResource/Pages/ViewMapPoint.php b/app/Filament/Resources/PointResource/Pages/ViewMapPoint.php index a4cc81b..6503afe 100644 --- a/app/Filament/Resources/PointResource/Pages/ViewMapPoint.php +++ b/app/Filament/Resources/PointResource/Pages/ViewMapPoint.php @@ -13,6 +13,7 @@ use Filament\Forms\Components\Checkbox; use Filament\Forms\Components\Group; use Filament\Forms\Components\Select; +use Filament\Forms\Components\SpatieMediaLibraryFileUpload; use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Toggle; @@ -21,6 +22,7 @@ use Filament\Infolists\Components\Actions\Action as InfolistAction; use Filament\Infolists\Components\IconEntry; use Filament\Infolists\Components\Section; +use Filament\Infolists\Components\SpatieMediaLibraryImageEntry; use Filament\Infolists\Components\TextEntry; use Filament\Infolists\Infolist; use Filament\Notifications\Notification; @@ -246,6 +248,9 @@ public function infolist(Infolist $infolist): Infolist ->inlineLabel() ->label(__('map_points.fields.free_of_charge')), + SpatieMediaLibraryImageEntry::make('images') + ->label(__('map_points.fields.images')), + ]) ->columns(3) ->columnSpan(12) @@ -309,6 +314,7 @@ public function infolist(Infolist $infolist): Infolist Textarea::make('observations') ->label(__('map_points.fields.observations')), + Group::make( [ Toggle::make('offers_transport') @@ -326,6 +332,12 @@ public function infolist(Infolist $infolist): Infolist ] )->columns(4), + SpatieMediaLibraryFileUpload::make('images') + ->previewable() + ->collection('default') + ->label(__('map_points.fields.images')) + ->multiple(), + ] )->label(__('map_points.buttons.edit_details')) ->action(fn (array $data) => $this->record->update($data)), diff --git a/lang/ro/map_points.php b/lang/ro/map_points.php index 2cd62b7..6e57850 100644 --- a/lang/ro/map_points.php +++ b/lang/ro/map_points.php @@ -82,6 +82,7 @@ 'offers_money' => 'Oferǎ bani', 'offers_vouchers' => 'Ofera vouchere', 'free_of_charge' => 'Oferă servicii gratuite', + 'images' => 'Imagini', 'business_name' => 'Nume business', ],