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

Supplier Management

@if (session('success')) @endif @if (session('error')) @endif @if ($errors->has('phno')) @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('Supplier Register', $choosePermission) || auth()->user()->is_admin == '1')
@endif

Supplier Table

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