From bae1a2acb0f8f7cd8a029c18ea64d87cccdde37d Mon Sep 17 00:00:00 2001 From: AmirmahdiNourkazemi Date: Wed, 3 Jun 2026 11:41:11 +0330 Subject: [PATCH] fix: mim type audio and video --- app/Http/Controllers/BackgroundSoundController.php | 2 +- app/Http/Controllers/BellSoundController.php | 2 +- app/Http/Controllers/MediaController.php | 4 ++-- app/Http/Controllers/MusicController.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/BackgroundSoundController.php b/app/Http/Controllers/BackgroundSoundController.php index 9c51db5..83bbc26 100644 --- a/app/Http/Controllers/BackgroundSoundController.php +++ b/app/Http/Controllers/BackgroundSoundController.php @@ -14,7 +14,7 @@ protected function modelClass(): string protected function fileFields(): array { return [ - 'sound' => ['column' => 'sound_path', 'folder' => 'background-sounds/sounds', 'rules' => 'nullable|mimes:mp3,wav,ogg,flac|max:102400'], + 'sound' => ['column' => 'sound_path', 'folder' => 'background-sounds/sounds', 'rules' => 'nullable|file|extensions:mp3,wav,ogg,flac,aac,m4a,opus,mpga,wma|max:102400'], 'image' => ['column' => 'image_path', 'folder' => 'background-sounds/images', 'rules' => 'nullable|image|max:8192'], ]; } diff --git a/app/Http/Controllers/BellSoundController.php b/app/Http/Controllers/BellSoundController.php index 3762938..d25cb3e 100644 --- a/app/Http/Controllers/BellSoundController.php +++ b/app/Http/Controllers/BellSoundController.php @@ -14,7 +14,7 @@ protected function modelClass(): string protected function fileFields(): array { return [ - 'sound' => ['column' => 'sound_path', 'folder' => 'bells/sounds', 'rules' => 'nullable|mimes:mp3,wav,ogg,flac|max:51200'], + 'sound' => ['column' => 'sound_path', 'folder' => 'bells/sounds', 'rules' => 'nullable|file|extensions:mp3,wav,ogg,flac,aac,m4a,opus,mpga,wma|max:51200'], 'image' => ['column' => 'image_path', 'folder' => 'bells/images', 'rules' => 'nullable|image|max:8192'], ]; } diff --git a/app/Http/Controllers/MediaController.php b/app/Http/Controllers/MediaController.php index 75355db..8972b6b 100644 --- a/app/Http/Controllers/MediaController.php +++ b/app/Http/Controllers/MediaController.php @@ -31,7 +31,7 @@ public function store(Request $request) 'image' => 'nullable|image|max:8192', 'duration' => 'nullable|integer', 'is_premium' => 'nullable|boolean', - 'file' => 'nullable|mimes:mp3,wav,mp4,mov|max:512000', + 'file' => 'nullable|file|extensions:mp3,wav,ogg,flac,aac,m4a,opus,mpga,wma,mp4,mov,m4v,webm,mkv,avi,3gp|max:512000', 'external_url' => 'nullable|string', 'visibility' => 'nullable|in:public,private', @@ -478,7 +478,7 @@ public function update(Request $request, $id) 'image_id' => 'nullable|exists:images,id', 'image' => 'nullable|image|max:8192', 'duration' => 'nullable|integer', - 'file' => 'nullable|mimes:mp3,wav,mp4,mov|max:512000', + 'file' => 'nullable|file|extensions:mp3,wav,ogg,flac,aac,m4a,opus,mpga,wma,mp4,mov,m4v,webm,mkv,avi,3gp|max:512000', 'external_url' => 'nullable|string', 'visibility' => 'nullable|in:public,private', 'tags' => 'nullable|array', diff --git a/app/Http/Controllers/MusicController.php b/app/Http/Controllers/MusicController.php index e834eb0..38eb58a 100644 --- a/app/Http/Controllers/MusicController.php +++ b/app/Http/Controllers/MusicController.php @@ -134,7 +134,7 @@ public function store(Request $request) $data = $request->validate([ 'title' => 'required|string|max:255', 'artist' => 'nullable|string|max:255', - 'file' => 'required|mimes:mp3,wav,ogg,flac|max:20971520', + 'file' => 'required|file|extensions:mp3,wav,ogg,flac,aac,m4a,opus,mpga,wma|max:20971520', 'type' => 'nullable|in:public,private', 'image_id' => 'nullable|exists:images,id', 'image' => 'nullable|image|max:8192', @@ -238,7 +238,7 @@ public function update(Request $request, $id) 'title' => 'nullable|string|max:255', 'artist' => 'nullable|string|max:255', 'type' => 'nullable|in:public,private', - 'file' => 'nullable|mimes:mp3,wav,ogg,flac|max:20971520', + 'file' => 'nullable|file|extensions:mp3,wav,ogg,flac,aac,m4a,opus,mpga,wma|max:20971520', 'image_id' => 'nullable|exists:images,id', 'image' => 'nullable|image|max:8192', 'duration' => 'nullable|integer|min:1',