I have some code like below, the thing I want to ask is with the exactly same // dd($example->count()) #10
why put dd()
on each different line has different value ? What change my $example
event I never reassign it ?
$example = $car->wheels()->whereBetween(
'created_at',
[
$starDay->format('Y-m-d h:i:s'),
$today->format('Y-m-d h:i:s')
]
)
$total = $example->count();
// dd($example->count()) #10
$totalSuccess = $example->where('status', 'good')->count();
// dd($example->count()) # 5
$colors = $example->select('color', DB::raw('count(*) as total'))
->groupBy('color')
->get()
->toArray();
// dd($example->count()) # []
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire