@php
$destroyRedirectUrl = $crud->getOperationSetting('destroyButtonRedirect');
if($destroyRedirectUrl && $destroyRedirectUrl instanceof \Closure){
$destroyRedirectUrl = $destroyRedirectUrl();
}
$destroyRedirectUrl = filter_var($destroyRedirectUrl, FILTER_VALIDATE_URL) ? $destroyRedirectUrl : url($crud->route);
@endphp
@if ($crud->hasAccess('destroy', $entry) && ($entry->trashed() || (!$entry->trashed() && $crud->getOperationSetting('canDestroyNonTrashedItems'))))
{{ trans('backpack/pro::trash.destroy') }}
@endif
{{-- Button Javascript --}}
{{-- - used right away in AJAX operations (ex: List) --}}
{{-- - pushed to the end of the page, after jQuery is loaded, for non-AJAX operations (ex: Show) --}}
@loadOnce('destroy_button_script')
@push('after_scripts') @if (request()->ajax()) @endpush @endif
@if (!request()->ajax()) @endpush @endif
@endLoadOnce