koel/app/Http/Requests/API/PlaylistFolderPlaylistStoreRequest.php

27 lines
562 B
PHP
Raw Normal View History

<?php
2023-06-05 21:46:41 +00:00
namespace App\Http\Requests\API;
use App\Models\Playlist;
2024-01-10 20:04:37 +00:00
use App\Rules\AllPlaylistsBelongTo;
use Illuminate\Validation\Rule;
/**
* @property-read array<int>|int $playlists
*/
class PlaylistFolderPlaylistStoreRequest extends Request
{
/** @return array<mixed> */
public function rules(): array
{
return [
2024-01-10 20:04:37 +00:00
'playlists' => [
'required',
'array',
new AllPlaylistsBelongTo($this->user()),
Rule::exists(Playlist::class, 'id'),
],
];
}
}