addBreadcrumb("/customers", __("Customers")); $nvp = []; $request = Request::fromRequest(); $customer_id = $request->int("customer_id"); if($customer_id) { $nvp["id"] = $customer_id; } $name = $request->string("name"); if($name) { $nvp["name"] = new HasTextConstraint($name); } $count = Customer::count($nvp); $pagination = new Pagination($count); $pagination->setTerms(__("%s customer"), __("%s customers")); $customers = Customer::query($nvp, [ "sort" => "name", "offset" => $pagination->getOffset(), "limit" => $pagination->getPageSize() ]); View::include("header"); View::include("customers", compact("customers", "pagination", "customer_id", "name")); View::include("footer");