fanatic/resources/views/components/admin/form/destroy.blade.php
Marley Rae 91bbf06126 g
2022-04-24 17:44:39 -07:00

28 lines
No EOL
583 B
PHP

@props([
'object',
'route',
'btnClass' => 'l-page-nav__link',
'label' => 'Delete',
'adminNav' => false
])
@php
$class = join('', array_slice(explode('\\', get_class($object)), -1));
@endphp
<button form="delete-{{ $class }}-{{ $object->id }}" class="{{ $btnClass }}" title="delete">
@if ($adminNav)
<span class="l-nav__link">
@endif
{{ $label }}
@if ($adminNav)
</span>
@endif
</button>
<form action="{{ route("$route", $object) }}" class="form--hidden"
id="delete-{{ $class }}-{{ $object->id }}" method="post">
@csrf
@method('DELETE')
</form>