如何在laravel中添加休假计数器?

I have 2 columns medical and casual leave, I have 2 medical leaves in my database , So i want count of that to leaves, instead of that it displays me 1 1, How can I resolve that?

here is my code of view file

<td>
@foreach($employeeLeave as $empleave)
@if($empName['personal_detail']['first_name'] == $empleave->name)
   @if($empleave->type == 'casual')
      {{ count([$empleave->type]) }}
   @endif
@endif
@endforeach
</td>
<td>
@foreach($employeeLeave as $empleave)
@if($empName['personal_detail']['first_name'] == $empleave->name)
   @if($empleave->type == 'medical')
      {{ count([$empleave->type]) }}
   @endif
@endif
@endforeach
</td>

You can do something like counting in loops at first and then populating

@php
$casualCount = $medicalCount = 0;
@endphp
@foreach($employeeLeave as $empleave)
   @if($empName['personal_detail']['first_name'] == $empleave->name)
        @if($empleave->type == 'casual')
             @php $casualCount++; @endphp
        @endif
        @if($empleave->type == 'medical')
            @php $medicalCount++; @endphp
        @endif
   @endif
@endforeach

And then your html

<td>
{{ $casualCount }}
</td>

<td>
{{ $medicalCount }}
</td>