Blame view

resources/views/partials/form/delete_button.blade.php 851 Bytes
b7c7a5f6   Alexey Boroda   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  @php
  $page = explode('/', $url)[1];
  $text = $text ? $text : $page;
  @endphp
  
  {!! Form::open([
      'id' => str_singular($page) . '-' . $item->$id,
      'method' => 'DELETE',
      'url' => [$url, $item->$id],
      'style' => 'display:inline'
  ]) !!}
  {!! Form::button('<i class="fa fa-trash-o" aria-hidden="true"></i> ' . trans('general.delete'), array(
      'type'    => 'button',
      'class'   => 'btn btn-danger btn-xs',
      'title'   => trans('general.delete'),
      'onclick' => 'confirmDelete("' . '#' . str_singular($page) . '-' . $item->$id . '", "' . trans_choice('general.' . $text, 2) . '", "' . trans('general.delete_confirm', ['name' => '<strong>' . $item->$value . '</strong>', 'type' => mb_strtolower(trans_choice('general.' . $text, 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
  )) !!}
  {!! Form::close() !!}