mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-13 16:12:09 +00:00
34 lines
762 B
PHP
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'],
|
|
];
|
|
}
|
|
}
|