Add form component
This commit is contained in:
parent
f9228fe901
commit
c3fad776f5
|
|
@ -0,0 +1,13 @@
|
||||||
|
@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>
|
||||||
Loading…
Reference in New Issue