2024-01-08 22:21:21 +00:00
|
|
|
<?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
|
|
|
|
2024-01-08 22:21:21 +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-08 22:21:21 +00:00
|
|
|
];
|
|
|
|
}
|
2024-01-09 18:34:40 +00:00
|
|
|
|
|
|
|
public function authorize(): bool
|
|
|
|
{
|
|
|
|
return License::isPlus();
|
|
|
|
}
|
2024-01-08 22:21:21 +00:00
|
|
|
}
|