belongsTo(Country::class); } public function activities() { return $this->belongsToMany(Activity::class,'activity_destination'); } // protected static function newFactory(): DestinationFactory // { // //return DestinationFactory::new(); // } /** * */ public function getFullImageAttribute() { $result = null; if($this->image_path) { $result = asset('storage/uploads/' . $this->image_path); } return $result; } /** * */ public function getCountryNameAttribute() { $result = null; if($this->country_id) { $result = optional($this->country)->name; } return $result; } }