14 lines
338 B
PHP
14 lines
338 B
PHP
@props(['action', 'method'=>'POST'])
|
|
@php
|
|
$method = strtoupper($method);
|
|
$formMethod = in_array($method, ['GET', 'POST']) ? $method : 'POST';
|
|
@endphp
|
|
|
|
<form {{ $attributes }} method="{{ $formMethod }}" action="{{ $action }}">
|
|
@csrf
|
|
@if( $formMethod !== $method)
|
|
@method($method)
|
|
@endif
|
|
{{ $slot }}
|
|
</form>
|