Created
August 22, 2013 18:52
-
-
Save francoishill/6311249 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Blog extends Eloquent | |
{ | |
public function images() | |
{ | |
return $this->has_many_and_belongs_to('Image') | |
->order_by('blog_image.id', 'asc'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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....