@extends('layouts.admin')
@section('title','Store Branch')
@section('admin-content')
YOUR PHYSICAL STORES
Store Branch. Manage your stores. Active switches save automatically.
Add branch +
@foreach(['code'=>'Store code','name'=>'Store name','state'=>'State','active'=>'Active'] as $key=>$label)
@php($selected=($filters['sort']??'state')===$key)
@php($direction=$filters['direction']??'asc')
{{ $label }} {{ $selected ? ($direction==='asc'?'↑':'↓') : '↕' }}
@endforeachActions
@forelse($branches as $branch){{ $branch->code }} {{ $branch->name }} {{ $branch->state ?: 'Not set' }} Edit
@emptyNo branches match. Adjust your filters or add a branch. @endforelse
@foreach(collect([null])->concat($branches->items()) as $branch)
@php($dialogId=$branch ? 'branch-'.$branch->id : 'branch-new')
any() && (string)old('editing_branch')===(string)($branch->id ?? 'new')) data-branch-reopen @endif>
{{ $branch ? 'Edit branch' : 'Add store branch' }} ×
@if($errors->any() && (string)old('editing_branch')===(string)($branch->id ?? 'new'))
Please check the following: @foreach($errors->all() as $error){{ $error }} @endforeach
@endif
@if($branch) @if($branch->used)This branch has purchase history. Deactivate it to stop new entries.
@else@endif @endif
@endforeach
@if($legacy)Match older branch names Select the correct store for each name previously entered. Existing labels stay unchanged. Matching connects the records and prevents the same receipt being used again under the new store name.
@foreach($legacy as $entry)@endforeach @endif
@endsection
@push('scripts') @endpush