From d316f392bc54837b7fe0ec05fca90acdedd0d597 Mon Sep 17 00:00:00 2001 From: Nurmuhammet Allanov Date: Mon, 28 Jul 2025 18:10:07 +0500 Subject: [PATCH] Update HomePageSettings to use file upload for background video: replace text input with FileUpload component, enforce file type and size restrictions, and adjust video source path in the homepage view for proper video display. --- app/Filament/Pages/HomePageSettings.php | 10 ++++++---- app/Filament/Pages/ManageSolutions.php | 2 +- resources/views/web/pages/home/index.blade.php | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/Filament/Pages/HomePageSettings.php b/app/Filament/Pages/HomePageSettings.php index 457a32f..e028d81 100644 --- a/app/Filament/Pages/HomePageSettings.php +++ b/app/Filament/Pages/HomePageSettings.php @@ -141,10 +141,12 @@ class HomePageSettings extends SettingsPage ->description('Upload or link the background video for the hero section.') ->icon('heroicon-o-camera') ->schema([ - TextInput::make('bg_video') - ->label('Background Video URL') - ->maxLength(255) - ->url() + FileUpload::make('bg_video') + ->label('Background Video') + ->acceptedFileTypes(['video/mp4', 'video/webm', 'video/ogg']) + ->maxSize(51200) // 50MB + ->disk('public') + ->directory('homepage-videos') ->required(), ]), diff --git a/app/Filament/Pages/ManageSolutions.php b/app/Filament/Pages/ManageSolutions.php index 9f31cb5..e21655a 100644 --- a/app/Filament/Pages/ManageSolutions.php +++ b/app/Filament/Pages/ManageSolutions.php @@ -35,7 +35,7 @@ class ManageSolutions extends SettingsPage ->required() ->maxLength(255), FileUpload::make('solutions_image') - ->label('Image') + ->label('Image 1060x453') ->image() ->directory('solutions') ->required(), diff --git a/resources/views/web/pages/home/index.blade.php b/resources/views/web/pages/home/index.blade.php index 2f69208..7f814d2 100644 --- a/resources/views/web/pages/home/index.blade.php +++ b/resources/views/web/pages/home/index.blade.php @@ -9,7 +9,7 @@