Skip to content

CRUD controller's index action should use paginate instead of all #130

@saidbakr

Description

@saidbakr

I have a Products CRUD controller that seems like:

public function index(Request $request)
    {
        $products = Products::all();

		return view('admin.products.index', compact('products'));
	}

In this way a serious performance issue should be occurred with large data models. I think it will be better if ::paginate() used instead of all()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions