@php /** * The one way a table row offers its actions. * * Tables were hand-built, so each invented its own action cell - some three inline icons, * some a mix of forms and modal triggers. The rule this encodes: the one or two actions a * user performs constantly stay inline and cost one click; everything rarer moves behind a * "⋮" menu so a row with six actions reads as calmly as a row with two. * * Each action is an array: * label (required) visible/assistive text * icon FontAwesome class, e.g. 'fa-pen' * href renders an ; omit together with `form` to render a plain '; } if (!empty($a['href'])) { // Optional passthrough attributes on the link (e.g. target="_blank" for a "view"). $data = ''; foreach (($a['attrs'] ?? []) as $k => $v) { $data .= ' ' . e((string) $k) . '="' . e((string) $v) . '"'; } return '' . $body . ''; } // No href and no form: a JS-driven control (modal trigger). Pass its data-* through. $data = ''; foreach (($a['attrs'] ?? []) as $k => $v) { $data .= ' ' . e((string) $k) . '="' . e((string) $v) . '"'; } return ''; }; @endphp
@foreach ($inlineActions as $a){!! $render($a, false) !!}@endforeach @if ($menuActions)
@endif