{{-- resources/views/components/admin/form-card.blade.php --}} {{-- Wraps any form in a card panel with title, action, method --}} {{-- Props: title, action (URL), method (POST/PUT/PATCH), enctype --}} @props([ 'title' => 'Form', 'action' => '#', 'method' => 'POST', 'enctype' => 'application/x-www-form-urlencoded', ]) @php $httpMethod = strtoupper($method); $formMethod = in_array($httpMethod, ['GET', 'POST']) ? $httpMethod : 'POST'; $spoofMethod = !in_array($httpMethod, ['GET', 'POST']) ? $httpMethod : null; $isMultipart = strtolower($enctype) === 'multipart'; @endphp

{{ $title }}

@csrf @if($spoofMethod) @method($spoofMethod) @endif {{ $slot }}