hasOne(Company::class, 'id', 'default_company_id'); } /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function payment() { return $this->belongsTo(Payment::class)->withTrashed(); } public function companies() { return $this->hasMany(Company::class); } public function company_users() { return $this->hasMany(CompanyUser::class); } public function getPlan() { return $this->plan ?: ''; } }