Campagne */ public function campagnes() { return $this->hasMany(\App\Models\Campagne::class, 'camp_siteId', 'site_id'); } /** * OneToMany * Site -> Contact */ public function contacts() { return $this->hasMany(\App\Models\Contact::class, 'contact_siteId', 'site_id'); } /** * The users that belong to the site. */ public function users() { return $this->belongsToMany(\App\Models\User::class, 'site_user', 'site_id', 'user_id'); } /** * OneToMany * Site -> Coupon */ public function coupons() { return $this->hasMany(\App\Models\Coupon::class, 'coupon_siteId', 'id'); } /** * @return string */ public function __toString(): string { return $this->site_id . " : " . $this->site_nom; } }