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>