2024-01-01 11:40:21 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests\API;
|
|
|
|
|
|
|
|
use App\Models\Song;
|
2024-05-19 05:49:42 +00:00
|
|
|
use Illuminate\Validation\Rules\Exists;
|
2024-01-01 11:40:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @property-read string $song
|
|
|
|
* @property-read int $position
|
|
|
|
*/
|
|
|
|
class UpdatePlaybackStatusRequest extends Request
|
|
|
|
{
|
2024-05-19 05:49:42 +00:00
|
|
|
/** @inheritdoc */
|
2024-01-01 11:40:21 +00:00
|
|
|
public function rules(): array
|
|
|
|
{
|
|
|
|
return [
|
2024-05-19 05:49:42 +00:00
|
|
|
'song' => ['required', 'string', new Exists(Song::class, 'id')],
|
2024-01-01 11:40:21 +00:00
|
|
|
'position' => 'required|integer',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|