
<?php
    $auth_user= authSession();
?>
{{ html()->form('DELETE', route('service.destroy', $data->id))->attribute('data--submit', 'service'.$data->id)->open() }}
<div class="d-flex justify-content-end align-items-center">
    @if(!$data->trashed())
   
        @if($auth_user->can('service delete'))
        <a class="me-2" href="{{ route('service.destroy', $data->id) }}" data--submit="service{{$data->id}}"
            data--confirmation='true' 
            data--ajax="true"
            data-datatable="reload"
            data-title="{{ __('messages.delete_form_title',['form'=>  __('messages.service') ]) }}"
            title="{{ __('messages.delete_form_title',['form'=>  __('messages.service') ]) }}"
            data-message='{{ __("messages.delete_msg") }}'>
            <i class="far fa-trash-alt text-danger"></i>
        </a>
        @endif
        @if(auth()->user()->hasAnyRole(['admin','provider']))
            <a class="me-2" href="{{ route('servicefaq.index',['id' => $data->id]) }}" title="{{ __('messages.add_form_title',['form' => __('messages.servicefaq') ]) }}"> 
                <span class="text-primary">
                    <svg height="16" width="16" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm169.8-90.7c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>    
                </span>
            </a>
        @endif
    @endif
    @if(auth()->user()->hasAnyRole(['admin','provider']) && $data->trashed())
        @if($data->trashed())
            <a href="{{ route('service.action', ['id' => $data->id, 'type' => 'restore']) }}"
                title="{{ __('messages.restore_form_title', ['form' => __('messages.service')]) }}"
            data--submit="confirm_form"
                data--confirmation="true"
                data--ajax="true"
                data-title="{{ __('messages.restore_form_title', ['form' => __('messages.service')]) }}"
                data-message="{{ __('messages.restore_msg') }}"
            data-datatable="reload"
                class="me-2">
            <i class="fas fa-redo text-primary"></i>
        </a>
        @endif
        <a href="{{ route('service.action',['id' => $data->id, 'type' => 'forcedelete']) }}"
            title="{{ __('messages.forcedelete_form_title',['form' => __('messages.service') ]) }}"
            data--submit="confirm_form"
            data--confirmation='true'
            data--ajax='true'
            data-title="{{ __('messages.forcedelete_form_title',['form'=>  __('messages.service') ]) }}"
            data-message='{{ __("messages.forcedelete_msg") }}'
            data-datatable="reload"
            class="me-2">
            <i class="far fa-trash-alt text-danger"></i>
        </a>
    @endif
</div>
{{ html()->form()->close()}}
