@extends('admin.layouts.app') @section('content')

{{ ucfirst($table) }} List

@php $table; @endphp @if($fields) @foreach ($fields as $field) @if($field->Type == 'text' || $field->Field == $table.'_id' || $field->Field == 'created_at' || $field->Field == 'updated_at' || $field->Field == 'deleted_at') @else @endif @endforeach @endif @if($records) @php $count = 1 @endphp @foreach($records as $record) @if($fields) @foreach($fields as $field) @php $field_name = $field->Field; @endphp @if($field->Type == 'text' || $field->Field == $table.'_id' || $field->Field == 'created_at' || $field->Field == 'updated_at' || $field->Field == 'deleted_at') @else @endif @endforeach @endif @php $count++ @endphp @endforeach @endif
Sno{{ $replace = str_replace('_', ' ', strtoupper($field->Field)) }}Action
{{$count}} @if($field_name == $table.'_status') @if($record->$field_name == '1') Active @else Inactive @endif @else @if($field->Type == "varchar(300)") @else @if($field->Type == "int(12)") @php $tableName = getTableNameByFieldName($field_name); print_r(get_name_by_id($tableName,$record->$field_name)); @endphp @else {!! $record->$field_name !!} @endif @endif @endif @php $records_id = "$table"."_id" @endphp @if($table == "testimonials") @if(Auth::user()->role_id == 2) @else @endif @endif
@endsection