with(['getArea'])->select()->toArray(); return $result; } public static function getDfaultArea($data){ $result = Area::where("lng",$data['longitude'])->where("lat",$data['latitude'])->find(); if($result == null){ return self::getDfault(); } // $r = City::where('city_id',$result['id'])->find(); // if($r == null){ // return self::getDfault(); // } return $result; } public static function getDfault(){ return Area::where("lng","121.472644")->where("lat","31.231706")->find(); } }