@extends('layouts.vertical', ["page_title"=> "Datatables"]) @section('css') @endsection @section('content')

{{$title}} Management

@if(isset($buttons)) @foreach($buttons as $button) {{$button['title']}} @endforeach @endif
@if(session()->has('message'))
{{ session()->get('message') }}
@endif @if(session()->has('error'))
{{ session()->get('error') }}
@endif
@foreach($fields as $field => $props) @endforeach @foreach($items as $item) @foreach($fields as $field => $props) @if($field != 'actions') @else @endif @endforeach @endforeach
{{$props['title']}}
@switch($props['type']) @case('image') @break @case('text') @case('select') {{ isset($item->{$field}) ? $item->{$field} : '' }} @break @case('date') {{ date("d M Y", strtotime($item->{$field})) }} @break @case('datetime') {{ date("d M Y, h:iA", strtotime($item->{$field})+19800 ) }} @break @endswitch @foreach($props['buttons'] as $key => $button) @switch($button) @case('edit') @break @case('delete') @break @default @php if(isset($button['href']) && $button['href'] != '') { $href = $item->{$button['href']}; } else { $querystring = $button['querystring']; foreach((array)$item as $k => $v) { if(strpos($querystring,'{'.strtoupper($k).'}') !== false) $querystring = str_replace('{'.strtoupper($k).'}', $v, $querystring); } $href = $base_url.'/'.$key.'?'.$querystring; } @endphp @endswitch @endforeach Process
@endsection @section('script') @endsection