protected function setUp() { $this->createApplication(); self::$css = \Larakit\StaticFiles\Css::instance(); self::$css->clearAll(); Config::set('larakit.lk-staticfiles.version', 'hash'); }
/** * Включение пакета с учетом правил использования include/exclude * @return bool */ function on() { if ($this->is_used) { return true; } $route = \Route::currentRouteName(); $exclude = self::maxIs($this->exclude, $route); $include = self::maxIs($this->include, $route); if ($exclude > $include || true === $exclude) { // исключаем } else { // подключаем //сперва подключим на страницу зависимости foreach ((array) $this->require as $require => $scopes) { Manager::package($require)->on(); } foreach ($this->deferred_scopes as $scope) { $this->scope($scope); } //затем подключим CSS foreach ($this->css as $url => $item) { $condition = Arr::get($item, 'condition', null); $media = Arr::get($item, 'media', null); $no_build = (bool) Arr::get($item, 'no_build', false); Css::instance()->add($url, $media, $condition, $no_build); } //затем подключим JS foreach ($this->js as $url => $item) { $condition = Arr::get($item, 'condition', null); $no_build = (bool) Arr::get($item, 'no_build', false); Js::instance()->add($url, $condition, $no_build); } } $this->is_used = true; return true; }
function laracss() { return \Larakit\StaticFiles\Css::instance(); }