koel/app/Http/Requests/API/ChangeSongsVisibilityRequest.php

27 lines
493 B
PHP
Raw Normal View History

<?php
namespace App\Http\Requests\API;
2024-01-09 18:34:40 +00:00
use App\Facades\License;
2024-01-10 20:04:37 +00:00
use App\Models\Song;
use Illuminate\Validation\Rule;
2024-01-09 18:34:40 +00:00
/**
* @property-read array<string> $songs
*/
class ChangeSongsVisibilityRequest extends Request
{
/** @return array<mixed> */
public function rules(): array
{
return [
2024-01-10 20:04:37 +00:00
'songs' => ['required', 'array', Rule::exists(Song::class, 'id')],
];
}
2024-01-09 18:34:40 +00:00
public function authorize(): bool
{
return License::isPlus();
}
}