mirror of
https://github.com/koel/koel
synced 2024-12-30 06:23:05 +00:00
24 lines
570 B
PHP
24 lines
570 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Controllers\V6\Requests;
|
||
|
|
||
|
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')],
|
||
|
];
|
||
|
}
|
||
|
}
|