fix: change music duration to int

This commit is contained in:
2026-05-22 21:36:34 +03:30
parent f3685d4ca9
commit e314f95656
3 changed files with 35 additions and 7 deletions
+2 -2
View File
@@ -127,7 +127,7 @@ public function store(Request $request)
'type' => 'nullable|in:public,private',
'image_id' => 'nullable|exists:images,id',
'playlist_id' => 'nullable|exists:music_playlists,id',
'duration' => 'nullable|string|regex:/^(?:\d+:)?[0-5]?\d:[0-5]\d$/', // validates mm:ss or hh:mm:ss
'duration' => 'nullable|integer|min:1', // validates mm:ss or hh:mm:ss
]);
// Handle file upload
@@ -210,7 +210,7 @@ public function update(Request $request, $id)
'file' => 'nullable|mimes:mp3,wav,ogg,flac|max:20971520',
'image_id' => 'nullable|exists:images,id',
'playlist_id' => 'nullable|exists:music_playlists,id',
'duration' => 'nullable|string|regex:/^(?:\d+:)?[0-5]?\d:[0-5]\d$/',
'duration' => 'nullable|integer|min:1',
'order' => 'nullable|integer',
'is_active' => 'nullable|boolean',
]);