'integer', 'post_id' => 'integer', 'text' => 'string' ]; public function user() { return $this->hasMany(User::class, 'id', 'user_id'); } public function post() { return $this->hasMany(Post::class, 'id', 'post_id'); } }