@extends('layouts.app', ['title' => __('Customers')]) @section('admin_title') {{ __('Customers') }} @endsection @section('content')

{{ __('Customers List') }}

@if(Route::currentRouteName() === "admin.customers.index") {{ __('Add Customer') }} @else {{ __('Add Customer') }} @endif {{ __('Edit Customer') }} {{ __('Delete Customer') }}
@include('partials.flash')
@if (auth()->user()->hasRole('superadmin'))
@foreach ($customers as $category) @php $parts = explode(' ', $category->name, 2); $first = $parts[0] ?? ''; $last = $parts[1] ?? ''; @endphp @php $states = [ 'Alabama' => 'AL', 'Alaska' => 'AK', 'Arizona' => 'AZ', 'Arkansas' => 'AR', 'California' => 'CA', 'Colorado' => 'CO', 'Connecticut' => 'CT', 'Delaware' => 'DE', 'Florida' => 'FL', 'Georgia' => 'GA', 'Hawaii' => 'HI', 'Idaho' => 'ID', 'Illinois' => 'IL', 'Indiana' => 'IN', 'Iowa' => 'IA', 'Kansas' => 'KS', 'Kentucky' => 'KY', 'Louisiana' => 'LA', 'Maine' => 'ME', 'Maryland' => 'MD', 'Massachusetts' => 'MA', 'Michigan' => 'MI', 'Minnesota' => 'MN', 'Mississippi' => 'MS', 'Missouri' => 'MO', 'Montana' => 'MT', 'Nebraska' => 'NE', 'Nevada' => 'NV', 'New Hampshire' => 'NH', 'New Jersey' => 'NJ', 'New Mexico' => 'NM', 'New York' => 'NY', 'North Carolina' => 'NC', 'North Dakota' => 'ND', 'Ohio' => 'OH', 'Oklahoma' => 'OK', 'Oregon' => 'OR', 'Pennsylvania' => 'PA', 'Rhode Island' => 'RI', 'South Carolina' => 'SC', 'South Dakota' => 'SD', 'Tennessee' => 'TN', 'Texas' => 'TX', 'Utah' => 'UT', 'Vermont' => 'VT', 'Virginia' => 'VA', 'Washington' => 'WA', 'West Virginia' => 'WV', 'Wisconsin' => 'WI', 'Wyoming' => 'WY', ]; @endphp @endforeach
# {{ __('Restorant Id') }} {{ __('Restorant Name') }} {{ __('First Name') }} {{ __('Last Name') }} {{ __('Email') }} {{ __('Phone') }} {{ __('Address') }} {{ __('Zip Code') }} {{ __('City') }} {{ __('State') }} {{ __('Created at') }} {{ __('Status') }}
{{ $category->restaurants->id }} {{ $category->restaurants->name }}{{ $first }} {{ $last }} {{ $category->email }} @if(strlen($category->phone) === 10) ({{ substr($category->phone, 0, 3) }}){{ substr($category->phone, 3, 3) }}-{{ substr($category->phone, 6) }} @else {{ $category->phone }} @endif {{ $category->address }} {{ $category->zip_code }} {{ $category->city }}{{ $states[$category->state] ?? $category->state }} {{ $category->created_at->format('Y-m-d H:i') }} @if($category->is_active == 1) {{ __('Active') }} @else {{ __('Not active') }} @endif
@else
@foreach ($customers as $category) @php $parts = explode(' ', $category->name, 2); $first = $parts[0] ?? ''; $last = $parts[1] ?? ''; @endphp @php $states = [ 'Alabama' => 'AL', 'Alaska' => 'AK', 'Arizona' => 'AZ', 'Arkansas' => 'AR', 'California' => 'CA', 'Colorado' => 'CO', 'Connecticut' => 'CT', 'Delaware' => 'DE', 'Florida' => 'FL', 'Georgia' => 'GA', 'Hawaii' => 'HI', 'Idaho' => 'ID', 'Illinois' => 'IL', 'Indiana' => 'IN', 'Iowa' => 'IA', 'Kansas' => 'KS', 'Kentucky' => 'KY', 'Louisiana' => 'LA', 'Maine' => 'ME', 'Maryland' => 'MD', 'Massachusetts' => 'MA', 'Michigan' => 'MI', 'Minnesota' => 'MN', 'Mississippi' => 'MS', 'Missouri' => 'MO', 'Montana' => 'MT', 'Nebraska' => 'NE', 'Nevada' => 'NV', 'New Hampshire' => 'NH', 'New Jersey' => 'NJ', 'New Mexico' => 'NM', 'New York' => 'NY', 'North Carolina' => 'NC', 'North Dakota' => 'ND', 'Ohio' => 'OH', 'Oklahoma' => 'OK', 'Oregon' => 'OR', 'Pennsylvania' => 'PA', 'Rhode Island' => 'RI', 'South Carolina' => 'SC', 'South Dakota' => 'SD', 'Tennessee' => 'TN', 'Texas' => 'TX', 'Utah' => 'UT', 'Vermont' => 'VT', 'Virginia' => 'VA', 'Washington' => 'WA', 'West Virginia' => 'WV', 'Wisconsin' => 'WI', 'Wyoming' => 'WY', ]; @endphp @endforeach
# {{ __('First Name') }} {{ __('Last Name') }} {{ __('Email') }} {{ __('Phone') }} {{ __('Address') }} {{ __('City') }} {{ __('State') }} {{ __('Zip Code') }} {{ __('Created at') }} {{ __('Status') }}
{{ $first }} {{ $last }} {{ $category->email }} @if(strlen($category->phone) === 10) ({{ substr($category->phone, 0, 3) }}){{ substr($category->phone, 3, 3) }}-{{ substr($category->phone, 6) }} @else {{ $category->phone }} @endif {{ $category->address }} {{ $category->city }}{{ $states[$category->state] ?? $category->state }} {{ $category->zip_code }} {{ $category->created_at->format('Y-m-d H:i') }} @if($category->is_active == 1) {{ __('Active') }} @else {{ __('Not active') }} @endif
@endif
@include('layouts.footers.auth')
@endsection @section('js') @endsection