2022-08-10 14:56:01 +00:00
|
|
|
<?php
|
|
|
|
|
2022-09-15 09:07:25 +00:00
|
|
|
namespace App\Http\Requests\V6\API;
|
2022-08-10 14:56:01 +00:00
|
|
|
|
|
|
|
use App\Http\Requests\API\Request;
|
|
|
|
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')],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|