I want make count when a user login and make order about some product This is my table
User : Id(1 to many->order), name, email, address, phone
order : Id, id_user, id_product, date, price, total_order, total_price
I have written
$count = order::where('id_user','Auth->user()')->count();
Code above does not work, if I write like this
$count = order::all()->count();
It work but count all the data even i login with different user