@php $current_route = $request->route()->getName(); $plants = \App\Models\Plant::select('name','id')->get(); $departments = []; $buildings = []; if(request('plant_id')){ $departments = \App\Models\Department::select('name','id')->where('plant_id',request('plant'))->get(); $buildings = \App\Models\Buildings::select('name','id')->where('plant_id',request('plant'))->get(); } $sections = []; if(request('department_id')){ $sections = \App\Models\Section::select('name','id')->where('dept_id',request('department'))->get(); } $zones = []; if(request('section_id')){ $zones = \App\Models\Zone::select('name','id')->where('section_id',request('section'))->get(); } $area_offices = []; if(request('zone_id')){ $area_offices = \App\Models\AreaOffice::select('ao_name','id')->where('zone_id',request('zone'))->get(); } $collection_points = []; $dispatch_points = []; if(request('ao_id')){ $collection_points = \App\Models\CollectionPoint::select('name','id')->where('area_office_id',request('ao_id'))->get(); $dispatch_points = \App\Models\DispatchPoint::select('name','id')->where('ao_id',request('ao_id'))->get(); $buildings = \App\Models\Buildings::select('name','id')->where('ao_id',request('ao_id'))->get(); } @endphp