@extends('layouts.customer') @section('content')

Customers

@can('user_create') Add Customer @endcan
@if ($message = Session::get('success'))

{{ $message }}

@endif
@if($customers) @php $i = 0; //echo '
'; print_r($customers); echo '
'; die; @endphp @foreach($customers as $customer) @php $total_points = 0; $loyality_program = $customer->loyality_program; $transection_points = $customer->transection_points; if( $transection_points ) { foreach ( $transection_points as $transection_point ) { if( '1' == $transection_point->trans_type ) { $total_points += $transection_point->point; } else if( '2' == $transection_point->trans_type ) { $total_points -= $transection_point->point; } } } @endphp @endforeach @else

No records found!

@endif
Name Email Address Verification Tier Total Orders Reward Points Created Action
@php $words = explode(' ', trim($customer->getName())); $initials = strtoupper(substr($words[0], 0, 1) . (isset($words[1]) ? substr($words[1], 0, 1) : '')); @endphp
{{ $initials }}
{{ $customer->email }} @if($customer->email_verified_at) {{ $customer->email_verified_at }} @else N/A @endif {{ $loyality_program ? ( $loyality_program->tier ? ($loyality_program->tier->title ?? '') : '' ) : '' }} {{ $customer->orders_count ?? 0; }} {{ $total_points ?? 0 }} {{ date('M d, y | h:i A',strtotime($customer->created_at)) }} @can('user_delete') @endcan
@endsection