companies()->limit(10)->get()->sortBy('name'); foreach ($companies as $com) { $com->setSettings(); } // Get customer if (Auth::user()->customer) { $customer = Auth::user(); } $view->with(['companies' => $companies, 'customer' => $customer]); } }