print days of a special month ? laravel

Viewed 43

I need to print only the records for the month of May

I get them with the variable

<td>{{ ($registro->created_at->format('d-m-Y')) }}</td>

I need to see only May results, how do I do it?

2 Answers

You can use if condition

 @if($user->created_at->format('M')=="May")
        <td>{{ ($registro->created_at->format('d-m-Y')) }}</td>
    @endif

or

 @if($user->created_at->format('m')=="05")
        <td>{{ ($registro->created_at->format('d-m-Y')) }}</td>
    @endif

Simply check May month in created_at date

@if($user->created_at->format('m')=="05")
    <td>{{ ($registro->created_at->format('d-m-Y')) }}</td>
@endif
Related