Support the ongoing development of Laravel.io →
posted 10 years ago
Eloquent

I have a query that counts rows in a table that equal 5. For some reason it is running multiple times.

img

Here is the code that renders the view

    public function manageDashboard()
    {
        $equipments = Equipment::where('status',1)->orderBy('order','ASC')->lists('name','id');
        $tickets = Ticket::whereNotIn('status',[3,4,5])->orderBy('updated_at','ASC')->get();
        $partial = Ticket::where('status',5)->count();
        return view('manage.tickets.dashboard', compact('tickets','equipments','partial'));
    }

.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.