mirror of
https://github.com/koel/koel
synced 2024-12-19 17:13:09 +00:00
26 lines
578 B
PHP
26 lines
578 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\API;
|
|
|
|
use App\Models\Playlist;
|
|
use App\Rules\AllPlaylistsAreAccessibleBy;
|
|
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 AllPlaylistsAreAccessibleBy($this->user()),
|
|
Rule::exists(Playlist::class, 'id'),
|
|
],
|
|
];
|
|
}
|
|
}
|