Skip to content
Advertisement

print days of a special month ? laravel

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?

Advertisement

Answer

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
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement