koel/app/Http/Requests/API/PlaylistFolderPlaylistDestroyRequest.php
2023-06-05 23:46:41 +02:00

22 lines
524 B
PHP

<?php
namespace App\Http\Requests\API;
use App\Models\Playlist;
use App\Rules\AllPlaylistsBelongToUser;
use Illuminate\Validation\Rule;
/**
* @property-read array<int>|int $playlists
*/
class PlaylistFolderPlaylistDestroyRequest extends Request
{
/** @return array<mixed> */
public function rules(): array
{
return [
'playlists' => ['required', 'array', new AllPlaylistsBelongToUser($this->user())],
'playlists.*' => [Rule::exists(Playlist::class, 'id')],
];
}
}