model->orderBy('id', 'asc')->get(); if ($categories->toArray()) { foreach ($categories as $key => $val) { $lists[$val->alias][] = $val; } } Cache::forever('link_categories', $lists); } return $lists; } }