@props([ /** * Entity context */ 'form' => null, // used for isPermission() checks, e.g. 'user' 'entityId', 'entityName' => 'Record', /** * URLs */ 'viewUrl' => null, // if set, View becomes a link (unless viewType = 'button') 'editUrl' => null, 'deleteUrl' => null, /** * View behavior */ 'viewType' => 'button', // 'button' | 'link' 'viewButtonClass' => 'btn-view-entity', /** * History modal behavior */ 'historyTarget' => '#versionHistoryModal', /** * Force hide/show actions (optional) */ 'showView' => true, 'showEdit' => true, 'showDelete' => true, 'showHistory' => true, ]) {{-- View --}} @if($showView && (!$form || isPermission('view', $form))) @if($viewType === 'link' && $viewUrl) View @else @endif @endif {{-- Edit --}} @if($showEdit && $editUrl && (!$form || isPermission('edit', $form))) Edit @endif {{-- Delete --}} @if($showDelete && $deleteUrl && (!$form || isPermission('delete', $form)))
@csrf @method('DELETE')
@endif {{-- History --}} @if($showHistory && (!$form || isPermission('view_history_modal', $form))) @endif