Skip to content

Instantly share code, notes, and snippets.

@francoishill
Created August 22, 2013 18:52
Show Gist options
  • Save francoishill/6311249 to your computer and use it in GitHub Desktop.
Save francoishill/6311249 to your computer and use it in GitHub Desktop.
<?php
class Blog extends Eloquent
{
public function images()
{
return $this->has_many_and_belongs_to('Image')
->order_by('blog_image.id', 'asc');
}
}
@pablocid
Copy link

Hi, you know how this code work's????
$relations =array('conditions_r', 'countries_r', 'species_r' =>function($q){ $q->orderBy('name'); });

Some::with($relations)->get();

the orderBy don't work and in the model don't work too....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment