Forms\Components\Select::make('region') ->options(Region::all()->pluck('name', 'id')->toArray()) ->default(function (?Model $record) { if ($record){ return $record->area->region->id; } }) ->live(), Forms\Components\Select::make('area_id') ->relationship('area', 'name') ->options(function (Get $get, ?Model $record) { if($get('region')){ return Area::where('region_id',$get('region'))->get()->pluck('name', 'id'); } if ($record){ return Area::where('region_id',$record->area->region->id)->get()->pluck('name', 'id'); } }) ->live(),