This loads 12 Candidates from the database.

```php
$candidates = Candidate::all()->where('vacancy_id', $id);

```

doing `count($candidates)` returns `12`

however in my foreach loop. such as

```php
$sum = 0;
@foreach($candidates as $candidate)
   $sum +=1;
@endforeach

```

yet `$sum` returns `10` instead of `12`.

any ideas?

Laravel 8
PHP 8