@extends('backend.layouts.master') @section('section-title', 'Brand') @section('page-title', 'Brand List') @section('action-button') Add Brand @endsection @section('content')
@forelse($brands as $data) @php $branch_id = session('branch_filter_id', auth()->user()->branch_id); if (auth()->user()->branch_id == 1 && !session('branch_filter_id')) { $branch_brand = App\Models\BranchBrand::where('brand_id', $data->id)->get(); } else { $branch_brand = App\Models\BranchBrand::where('brand_id', $data->id) ->where('branch_id', auth()->user()->branch_id) ->get(); } $count_cat = App\Models\Product::where('brand_id', $data->id)->count(); @endphp @php $selectedBranchIds = \App\Models\BranchBrand::where( 'brand_id', $data->id, )->pluck('branch_id'); @endphp {{-- edit modal --}} @csrf @method('PUT') @if (auth()->user()->branch_id == 1) @foreach ($branchs as $branch) @endforeach @endif {{-- delete modal --}} @csrf @method('DELETE') @empty @endforelse
#SL Name Branch Actions
{{ $loop->index + 1 }} {{ $data->name }} @foreach ($branch_brand as $branch) {{ $branch->branch?->name }} @endforeach
No Data Available
{{-- Add Modal --}}
@csrf @if (auth()->user()->branch_id == 1) @foreach ($branchs as $data) @endforeach @endif
@endsection