Did you try with a properly defined Eloquent one-to-many relation and eager loading?
I think this wouldn't be affected by the issue.
Yes, my models look something like this:
class Author extends Eloquent
{
public function books()
{
return $this->hasMany('Book');
}
}
class Book extends Eloquent
{
public function author()
{
return $this->belongsTo('Author');
}
public function test()
{
return 'Test';
}
}
If you look at my examples above you'll see they are working fine, until I want to grab columns with the same name ("Slug" in this case).
$books = Book::with('author')->where('category_id', '=', 1)->get();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community