protected function handleGroupsType() { foreach ($this->config['groups'] as $gid => $buttons) { foreach ($buttons as $bid => $button) { $this->button($bid, $button, $gid); } } $groupIds = $this->buttons->pluck('groupId')->unique(); $groups = []; foreach ($groupIds as $gid) { $groups[$gid] = $this->buttons->where('groupId', $gid)->all(); } return $this->render(compact('groups')); }
public static function registerExtension($class, $name, $extension) { if (null === static::$resolved) { static::$resolved = new Collection(); } \Illuminate\Container\Container::getInstance()->resolving($class, function ($instance) use($name, $extension) { $className = get_class($instance); $isExtended = static::$resolved->where('className', $className)->where('name', $name)->count() > 0; if ($isExtended) { return; } static::$resolved->push(compact('className', 'name')); forward_static_call_array($className . '::extend', [$name, $extension]); }); }