koel/app/Http/Requests/API/PlaylistFolderPlaylistDestroyRequest.php
2024-07-06 17:44:41 +02:00

26 lines
564 B
PHP

<?php
namespace App\Http\Requests\API;
use App\Models\Playlist;
use App\Rules\AllPlaylistsBelongTo;
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 AllPlaylistsBelongTo($this->user()),
Rule::exists(Playlist::class, 'id'),
],
];
}
}