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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -