-
app/Http/ViewComposers/Modules.php
Open in GitHubclass Modules { public function compose(View $view) { if (setting('apps.api_key')) { $categories = Cache::remember('modules.categories.' . language()->getShortCode(), Date::now()->addHour(6), function () { return collect($this->getCategoriesOfModules())->pluck('name', 'slug') ->prepend(trans('general.all_type', ['type' => trans_choice('general.categories', 2)]), '*'); }); } else { $categories = collect([ '*' => trans('general.all_type', ['type' => trans_choice('general.categories', 2)]), ]); } $view->with(['categories' => $categories]); } }