user) { $this->redirect(url('auth/login')); } if (!$this->user->is_admin) { $this->redirect(url('/')); } } protected function getConfigs($keys) { $data = Config::order('type', 'asc')->all(); $configs = []; foreach ($data as &$value) { if (in_array($value->key, $keys)) { $configs[$value->key][] = $value; } } return $configs; } }