@extends('layouts.master') @section('title') @isset($data) @if($data->tenant_type == 'Restaurant') Add Branch @else Edit Outlet @endif @else Add Branch @endisset @endsection @section('content') @php use DipeshSukhia\LaravelCountryStateCityData\Models\Country; use DipeshSukhia\LaravelCountryStateCityData\Models\State; use DipeshSukhia\LaravelCountryStateCityData\Models\City; // Get old values for country, state, city $oldCountry = old('country', isset($data) ? $data->country : null); $oldState = old('state', isset($data) ? $data->state : null); $oldCity = old('city', isset($data) ? $data->city : null); // Get all countries for the dropdown $countries = \App\Models\Country::all(); // Get states and cities if editing $states = collect(); $cities = collect(); if ($oldCountry) { $states = \App\Models\State::where('country_id', $oldCountry)->get(); } if ($oldState) { $cities = \App\Models\City::where('state_id', $oldState)->get(); } @endphp
@csrf @isset($data) @endisset

@isset($data) @if($data->tenant_type == 'Restaurant') ADD Branch @else ADD Outlet @endif @else Add Branch @endisset

@isset($data) @if($data->tenant_type == 'Food Court') {{-- Food Court ID --}}
@error('food_court_id')
{{ $message }}
@enderror
{{-- Food Court Name --}}
@error('food_court_name')
{{ $message }}
@enderror
{{-- Shop Count --}}
@error('shop_count')
{{ $message }}
@enderror
{{-- Outlet Contact Name --}}
@error('outlet_contact_name')
{{ $message }}
@enderror
{{-- Outlet Contact Phone --}}
@error('outlet_contact_phone')
{{ $message }}
@enderror
{{-- Outlet Contact Email --}}
@error('outlet_contact_email')
{{ $message }}
@enderror
@else {{-- Branch Name --}}
@error('branch_name')
{{ $message }}
@enderror
{{-- Branch Address --}}
@error('branch_address')
{{ $message }}
@enderror
{{-- Branch Contact Name --}}
@error('branch_contact_name')
{{ $message }}
@enderror
{{-- Branch Contact Phone --}}
@error('branch_contact_phone')
{{ $message }}
@enderror
{{-- Branch Contact Email --}}
@error('branch_contact_email')
{{ $message }}
@enderror
{{-- Location --}}
@error('location')
{{ $message }}
@enderror
{{-- Country Dropdown --}}
@error('region')
{{ $message }}
@enderror
{{-- State Dropdown --}}
@error('state')
{{ $message }}
@enderror
{{-- City Dropdown --}}
@error('city')
{{ $message }}
@enderror
{{-- Reservation Toggle --}}
reservation ?? false) ? 'checked' : '' }}>
{{-- Advanced Seating Toggle --}}
advanced_seating ?? false) ? 'checked' : '' }}>
@endif @else {{-- Regular branch form fields here (same as above) --}} {{-- ... your existing branch form fields ... --}} @endisset {{-- Submit --}}
@endsection