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.
This commit is contained in:
@@ -141,10 +141,12 @@ class HomePageSettings extends SettingsPage
|
|||||||
->description('Upload or link the background video for the hero section.')
|
->description('Upload or link the background video for the hero section.')
|
||||||
->icon('heroicon-o-camera')
|
->icon('heroicon-o-camera')
|
||||||
->schema([
|
->schema([
|
||||||
TextInput::make('bg_video')
|
FileUpload::make('bg_video')
|
||||||
->label('Background Video URL')
|
->label('Background Video')
|
||||||
->maxLength(255)
|
->acceptedFileTypes(['video/mp4', 'video/webm', 'video/ogg'])
|
||||||
->url()
|
->maxSize(51200) // 50MB
|
||||||
|
->disk('public')
|
||||||
|
->directory('homepage-videos')
|
||||||
->required(),
|
->required(),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class ManageSolutions extends SettingsPage
|
|||||||
->required()
|
->required()
|
||||||
->maxLength(255),
|
->maxLength(255),
|
||||||
FileUpload::make('solutions_image')
|
FileUpload::make('solutions_image')
|
||||||
->label('Image')
|
->label('Image 1060x453')
|
||||||
->image()
|
->image()
|
||||||
->directory('solutions')
|
->directory('solutions')
|
||||||
->required(),
|
->required(),
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<div class="banner__four">
|
<div class="banner__four">
|
||||||
{{-- BG video --}}
|
{{-- BG video --}}
|
||||||
<div class="bg-video">
|
<div class="bg-video">
|
||||||
<video autoplay muted loop id="myVideo"><source src="{{ $homeSettings->bg_video }}" type="video/mp4"></video>
|
<video autoplay muted loop id="myVideo"><source src="/storage/{{ $homeSettings->bg_video }}" type="video/mp4"></video>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- Hero --}}
|
{{-- Hero --}}
|
||||||
|
|||||||
Reference in New Issue
Block a user