Files
scrum-poker-internal/app/Http/Requests/UpdateRoomSettingsRequest.php
T
2026-09-02 09:37:11 +02:00

34 lines
762 B
PHP

<?php
namespace App\Http\Requests;
use App\Models\Room;
use Illuminate\Foundation\Http\FormRequest;
class UpdateRoomSettingsRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
$room = $this->route('room');
return $room instanceof Room
&& $this->user()?->id === $room->owner_id;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, array<int, string>>
*/
public function rules(): array
{
return [
'allow_participants_to_manage_rounds' => ['required', 'boolean'],
'is_persistent' => ['required', 'boolean'],
];
}
}