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
|
|
|
|
2024-06-04 09:44:33 +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
|
|
|
|
{
|
2024-06-04 09:44:33 +00:00
|
|
|
/** @inheritdoc */
|
2022-07-04 10:39:02 +00:00
|
|
|
public function rules(): array
|
|
|
|
{
|
|
|
|
return [
|
2024-06-04 09:44:33 +00:00
|
|
|
'songs' => ['required', 'array', new AllPlayablesAreAccessibleBy($this->user())],
|
2022-07-04 10:39:02 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|