@props( [ 'title' => null, 'icon' => null, 'route' => url()->current(), 'formAction' => null, 'formMethod' => 'POST', 'formName' => null, 'formSubmitPrevent' => null, // adiciona wire:formSubmitPrevent= ao form 'item' => null, // registro atual, é passado para os controles filho para mostrar valor padrão 'noAlerts' => false, // pula o widget de alerts ] ) {{-- Inclui dependencias do liveWire --}} @pushOnce('headScripts') @livewireStyles @endPushOnce @pushOnce('endBodyScripts') @livewireScripts @endPushOnce @section('scripts') @parent @endsection @if(isset($formAction)) @php // Nome edefault do form $formName = $formName ?? 'form-'.(str_replace(['//', '/'], '-', str_replace(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], '', substr(str_replace(url('/panel'), '', url()->current()), 1)))); @endphp @endif {{--ERROS --}} @if(!$noAlerts) @include('components.widget.alerts') @endif {{-- corpo da página --}}
merge(['class' => 'card shadow mb-4'])}}> {{-- Cabeçalho --}}
@if( $icon ) @endif {{$title}}
@if(isset($formAction))
@csrf @if($formMethod =='PUT') @method('PUT')@endif @endif
{!! $slot !!}
@if(isset($formAction))
@if(isset($buttonSlot)) {{$buttonSlot}} @else {{-- Ações padrão: Submit e Back --}} @endif
@endif @if(isset($formAction))
@endif