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

20 lines
376 B
PHP
Raw Normal View History

2022-07-04 10:39:02 +00:00
<?php
2023-06-05 21:46:41 +00:00
namespace App\Http\Requests\API;
2022-07-04 10:39:02 +00:00
use App\Rules\AllPlayablesAreAccessibleBy;
2022-07-04 10:39:02 +00:00
/**
2022-07-27 15:32:36 +00:00
* @property-read array<string> $songs
2022-07-04 10:39:02 +00:00
*/
class AddSongsToPlaylistRequest extends Request
{
/** @inheritdoc */
2022-07-04 10:39:02 +00:00
public function rules(): array
{
return [
'songs' => ['required', 'array', new AllPlayablesAreAccessibleBy($this->user())],
2022-07-04 10:39:02 +00:00
];
}
}