@extends('layouts.dashboard') @section('content') @php /** * Admin → Roles → New / Edit role. Name the role, then pick what it may do. * * @var array|null $role the role being edited, or null when creating * @var array $catalogue config/permissions.php — module => ['label', 'perms'] * @var array $held privilege slugs currently ticked * @var array $pills selectable badge colours * @var int $labelMax max length of the name field * @var int $descMax max length of the description field */ $role = $role ?? null; $catalogue = $catalogue ?? []; $held = $held ?? []; $pills = $pills ?? ['blue']; $isEdit = $role !== null; $curPill = (string) ($role['pill'] ?? ''); if (!in_array($curPill, $pills, true)) { $curPill = $pills[0]; } $total = count(\App\Models\Role::catalogueSlugs()); $chosen = count(array_intersect($held, \App\Models\Role::catalogueSlugs())); @endphp @php /* .qm-d2: the dashboard density standard (app.css §35) */ @endphp