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

19 lines
432 B
PHP

<?php
namespace App\Http\Requests\API;
use App\Enums\PlayableType;
use App\Models\Song;
use Illuminate\Validation\Rule;
/** @property-read array<string> $songs */
class DeleteSongsRequest extends Request
{
/** @return array<mixed> */
public function rules(): array
{
return [
'songs' => ['required', 'array', Rule::exists(Song::class, 'id')->where('type', PlayableType::SONG)],
];
}
}