@extends('admin.layouts.app') @section('title', 'Edit Team — '.$team->name) @section('content')
{{-- Header --}}
← Back to Teams

{{ $team->name }}

{{ $team->place->name ?? 'N/A' }} {{ $team->is_active ? 'Active' : 'Inactive' }} {{ $team->slug }}
@if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
@endif {{-- 1. BASIC DETAILS --}}
@csrf
Basic Details
{{-- 2. PERMISSION MATRIX (allow / unallow) --}}
@csrf
Permissions — Allow / Unallow {{ count($selectedIds) }}/{{ $perm_total }}
Allow / Unallow: tick = that action is ALLOWED for the team, untick = UNALLOWED. A new team starts empty — tick whatever you need. This team will only work within its own Place. Enforcement is LIVE now: Super Admin = bypass, everyone else = Role capability ⋀ Team allowance.
@foreach($modules as $module => $permissions)
{{ preg_replace('/^(View|Create|Edit|Update|Delete|Publish|Toggle|Manage|Review) /', '', $permissions->first()->label) }} {{ $module }}
@foreach($permissions as $permission) @php $checked = in_array($permission->id, $selectedIds, true); @endphp @endforeach
@endforeach
{{-- 3. MEMBERS --}}
@csrf
Members {{ count($memberIds) }} member(s) / {{ $users->count() }} user(s)
@if($users->isEmpty())
No users yet — create a user from the Users module first.
@else
@foreach($users as $user) @php $isMember = in_array($user->id, $memberIds, true); @endphp @endforeach
@endif
{{-- 4. DANGER ZONE --}}
Danger Zone
Deleting a team also removes its members and permission links (cascade). The Place stays safe.
@csrf @method('DELETE')
{{-- Contract note --}}
Isolation contract: Place → Team → User → Role → Permission → Content — its workspace = {{ $team->place->name ?? 'N/A' }}. Members' individual capability comes from their Role (Administration → Roles), and this team's allowance comes from here — both are applied together (enforcement LIVE).
@endsection