lawkunchi
270
13
Laravel

How to get monthly users Month by Month for a table

Posted 5 months ago by lawkunchi

I have a table which tally number of users against the month they were created. So I'm stuck on how to get number of users for each month.

<table>
        <thead>
            <tr>
                <th>Jan</th>
                <th>Feb</th>
                <th>March</th>
                <th>Apr</th>
                <th>May</th>
            </tr>
        </thead>
        <tbody>

            @foreach($users as $user)
            <tr>
                <td>{{ $user->created_at->format('M')->count}}</td> //Stuck here
            </tr>
           @endforeach

        </tbody>
 </table>

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.