mirror of
https://github.com/koel/koel
synced 2024-12-22 10:33:16 +00:00
25 lines
627 B
PHP
25 lines
627 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\API;
|
|
|
|
use App\Models\PlaylistFolder;
|
|
use App\Rules\ValidSmartPlaylistRulePayload;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
/**
|
|
* @property-read string $name
|
|
* @property-read int|null $folder_id
|
|
* @property-read array $rules
|
|
*/
|
|
class PlaylistUpdateRequest extends Request
|
|
{
|
|
/** @return array<mixed> */
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'name' => 'required',
|
|
'rules' => ['array', 'nullable', new ValidSmartPlaylistRulePayload()],
|
|
'folder_id' => ['nullable', 'sometimes', Rule::exists(PlaylistFolder::class, 'id')],
|
|
];
|
|
}
|
|
}
|