this is one of the reasons where Repositories come in handy
other than writing a query scope (http://laravel.com/docs/eloquent#query-scopes) I wouldn't know how to do it
I've written a couple of posts about repositories in L4 if you are interested, http://blog.zenry.nl
I have never tried this, bus i think you should be able to override get method in you mode, smth like this:
class YourModel extends Eloquent {
protected $table = 'table';
public function get()
{
parent::orderBy('column', 'DESC')->get();
}
}
Good thought, but it appears to not work :(
Tried that, still no
public static function get()
{
return parent::orderBy('column', 'DESC')->get();
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community