使用这个简单的示例,我可以获取表“comments”中的列,但无法获取表“post”中的列。我知道我可以使用“Fluent join”,但它在 Eloquente 中可行吗?谢谢!
class Post extends Eloquent {
public function comments()
{
return $this->has_many('Comment');
}
}
$comments = Post::find(1)->comments()->get();