hasOne(User::class, [ 'blog_id' => 'id' ]); } public function getCompany() { return $this->hasOne(Company::class, [ 'blog_id' => 'id' ]); } /** * {@inheritDoc} */ public function tableName() { return "blogs"; } }