user()->companies; $data['current_company'] = $companies->first(function ($company){ return $company->id == auth()->user()->company()->id; }); $data['companies'] = $companies->reject(function ($company){ return $company->id == auth()->user()->company()->id; }); return $data; } }