Is it possible in Laravel create one query which separate count all records from 3 different not related tables? And without using Eloquent.
Example: I have three tables, A, B, C. I can make three separate query's that will count all records in every table. Like "DB::table('A')->count();"
But I need a one query to do this. $all = DB:: ??
And as a result of this variable I will get something like:
$all->A
$all->B
$all->C
Thank you.
You can just write the raw query:
Then the counts would be at
$result->a
,$result->b
,$result->c