We were talking about Laravel 5 on its release, we are pleased today to welcome Laravel 5.1
Corral model:
public function sheeps() { return $this->hasMany('App\Sheep'); }
I want to order by number of sheep in each corral and get corral with fewest sheep number:
$corral = Corral::orderBy(..., 'ASC')->first();
Aucun commentaire:
Enregistrer un commentaire