Add room participant moderation

This commit is contained in:
2026-09-03 11:35:05 +02:00
parent e30d2e61aa
commit 2f05e56089
14 changed files with 453 additions and 15 deletions
@@ -0,0 +1,35 @@
<?php
namespace App\Http\Requests;
use App\Models\Player;
use App\Models\Room;
use Illuminate\Foundation\Http\FormRequest;
class KickRoomPlayerRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
$room = $this->route('room');
$player = $this->route('player');
return $room instanceof Room
&& $player instanceof Player
&& $this->user()?->id === $room->owner_id
&& $player->room_id === $room->id
&& $player->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 [];
}
}