'required|in:admin,editor,viewer', ]; } public function mount(int $memberId): void { $workspace = app('current_workspace'); $member = WorkspaceMember::where('id', $memberId) ->where('workspace_id', $workspace->id) ->firstOrFail(); $this->memberId = $memberId; $this->memberName = $member->user->name ?? ''; $this->role = $member->role; } public function save(): void { $this->validate(); $workspace = app('current_workspace'); $member = WorkspaceMember::where('id', $this->memberId) ->where('workspace_id', $workspace->id) ->firstOrFail(); $member->update(['role' => $this->role]); $this->dispatch('memberRoleUpdated', memberId: $this->memberId); $this->closeModal(); } public static function modalMaxWidth(): string { return 'sm'; } public function render(): \Illuminate\View\View { return view('livewire.modals.edit-member-role'); } }