mysql - Eloquent Inner Join count -
i want count rows in table "links" links.page_id = pages.id.
$link_item = link::where('links.friendly_url', $id) ->join('pages','pages.id','=','links.page_id') ->select('pages.description pdescription', 'pages.name', 'pages.photo pphoto', 'pages.id pid', 'links.*') ->get(); return view('site.link', compact('link_item'));
how can it?
just add ->count()
end of query have it, or can
$link_item_count => $link_item->count();
Comments
Post a Comment