@php /** * @var $modelsList array * @var $labels array * @var $attributes array * @var $customActionsBefore callable|null * @var $viewRoute string|null * @var $editRoute string|null * @var $destroyRoute string|null **/ $showActionCollumn = isset($customActionsBefore) || isset($viewRoute) || isset($editRoute) || isset($destroyRoute); @endphp @foreach ($labels as $label) @endforeach @if ($showActionCollumn) @endif @foreach($modelsList as $key => $model) @if (is_object($model) && method_exists($model, 'getKey')) @php($modelKey = $model->getKey()) @elseif ((is_array($model) && array_key_exists('id', $model)) || (is_object($model) && property_exists($model, 'id'))) @php ($modelKey = is_array($model) ? $model['id'] : $model->id) @endif @foreach ($attributes as $attr) @php($cellValue = '') {{--Get Cell value--}} @if (is_array($attr)) @php ($type = $attr[0]) @php ($params = $attr[1]) @if ($type == 'raw') @php($cellValue = $params) @elseif ($type == 'lambda') @php($cellValue = $params($model)) @elseif ($type == 'twoSeparatedValues') @php($cellValue = $model->{$params[0]} . $params[1] . $model->{$params[2]}) @endif @elseif (is_string($attr)) @if (is_array($model)) @php($model = (object)$model) @endif @if (is_array($model->{$attr})) @foreach ($model->{$attr} as $val) @php($cellValue .= "

{$val}

") @endforeach @else @if(strpos($attr, '.') !== false) @php($ex = explode('.', $attr, 2)) @if (isset($model->{$ex[0]})) @php($cellValue = $model->{$ex[0]}->{$ex[1]}) @else @php($cellValue = '') @endif @else @php($cellValue = $model->{$attr}) @endif @endif @endif @if($cellValue instanceof \Carbon\Carbon) @else @endif @endforeach @if (isset($modelKey) && $showActionCollumn) @endif @endforeach
{{ $label }}{{ __('main.actions') }}
{!! \Gameap\Helpers\DateHelper::convertToLocal($cellValue) !!}{!! $cellValue !!} @if (isset($customActionsBefore)) {!! $customActionsBefore($modelKey, $model) !!} @endif @if (isset($viewRoute))  {{ __('main.view') }} @endif @if (isset($editRoute))  {{ __('main.edit') }} @endif @if (isset($destroyRoute)) {{ Form::open(['id' => 'form-destroy-' . $modelKey, 'url' => route($destroyRoute, $modelKey), 'style'=>'display:inline']) }} {{ Form::hidden('_method', 'DELETE') }} {{ Form::button( ' ' . __('main.delete') . '', [ 'class' => 'btn btn-danger btn-sm btn-delete', 'title' => __('main.delete'), 'v-on:click' => !isset($destroyConfirmAction) ? 'confirmAction($event, \'' . __('main.confirm_message'). '\')' : $destroyConfirmAction, 'type' => 'submit' ] ) }} {{ Form::close() }} @endif