@include('layouts.header')
@include('layouts.sidebar')

Customer Management

@if (session('success')) @endif @if (session('error')) @endif @if ($errors->has('phno')) @endif @if (session('trycache')) @endif
{{-- Permission --}} @php $choosePermission = []; if (auth()->user()->permission) { $decodedPermissions = json_decode(auth()->user()->permission, true); if (json_last_error() === JSON_ERROR_NONE) { $choosePermission = $decodedPermissions; } } @endphp {{-- End Permission --}} @if (in_array('Customer Register', $choosePermission) || auth()->user()->is_admin == '1')
@endif

Customer Table

@php $no = '1'; @endphp @foreach ($customers as $customer) @php $no++; @endphp @endforeach
No. Name Phone Number Customer Type Location Address Action
{{ $no }} {{ $customer->name }} {{ $customer->phno }} {{ $customer->type }} @foreach ($branchs as $branch) @if ($branch->id == $customer->branch) {{ $branch->name }} @endif @endforeach {{ $customer->address }}
@if (in_array('Customer Edit', $choosePermission) || auth()->user()->is_admin == '1') @endif @if (in_array('Customer Delete', $choosePermission) || auth()->user()->is_admin == '1') @endif @if (in_array('Customer Credit', $choosePermission) || auth()->user()->is_admin == '1') Credit @endif