lundi 30 mai 2016

laravel 5.2 eloquent orderby on relationship result count

i have two tables website_link and website_links_type, website_link is related website_links_type with hasmany relationship.

$this->website_links->where('id',1)->Paginate(10);

and realtionship

 public function broken()
{
    return $this->hasMany('App\Website_links_type')->where('status_code','!=',"200");

}

now i want to get result from website_link table but Orderby that result on count of broken relationship result.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire