/** * Boot the application events. * * @return void */ public function boot() { $this->registerConfig(); $this->registerTranslations(); $this->registerViews(); View::composer(['partials.header'], 'Modules\\Notifications\\Http\\ViewComposers\\NotificationComposer'); }
protected function shareFis() { $fis = $this->app->make('fis'); View::composer('*', function ($view) use($fis) { $view->with('__fis', $fis); }); }
/** * Bootstrap any application services. * * @return void */ public function boot() { View::composer('*', function ($view) { $view->with('currentUser', Auth::user()); $view->with('signedIn', Auth::user()); }); }
protected function setupLayout() { $is_rapyd = (Request::server('HTTP_HOST') == "www.rapyd.com") ? true : false; View::composer('rapyd::demo.*', function ($view) use ($is_rapyd) { $view->with('is_rapyd', $is_rapyd); }); }
public function __construct() { //$this->beforeFilter(function(){ }); $this->uriSegment = null; $this->modelName = null; $this->viewsPath = null; $this->resourceId = null; if (Route::input('alias') !== null) { $this->uriSegment = Route::input('alias'); $this->viewsPath = File::exists(app_path('views/' . Config::get('reactiveadmin::uri') . '/' . $this->uriSegment)) ? Config::get('reactiveadmin::uri') . '.' . $this->uriSegment : 'reactiveadmin::default'; $this->modelName = studly_case(str_singular(Route::input('alias'))); $this->modelWrapper = App::make('model_wrapper'); $this->modelWrapper->model($this->modelName); if (Route::input('id') !== null) { $this->resourceId = Route::input('id'); } View::share('config', $this->modelWrapper->getConfig()); // TODO: refactor this! // custom behavior switch ($this->uriSegment) { case 'settings': View::composer(array('admin.' . $this->viewsPath . '.index'), function ($view) { $view->with('settings', Settings::all()); }); break; default: # code... break; } } View::share('view', $this->uriSegment); View::share('model', $this->modelName); }
private function setWidgetComposer($widget) { View::composer('dashboard.dashboard', function ($view) use($widget) { $view->with('widget', $widget); }); return $this; }
/** * Register any application services. * * @return void */ public function register() { $this->app->bind('App\\Lambda\\Repositories\\LambdaRepositoryInterface', 'App\\Lambda\\Repositories\\LambdaRepository'); // $this->app->bind('App\Lambda\Billing\BillingInterface', 'App\Lambda\Billing\StripeBilling'); View::composer('partials.sidebar', 'App\\Lambda\\Composers\\SidebarComposer'); View::composer(['partials.admin-sidebar', 'dashboard/*'], 'App\\Lambda\\Composers\\AccountSidebarComposer'); View::composer(['partials.nav', 'errors/404'], 'App\\Lambda\\Composers\\NavComposer'); }
/** * @return void */ public function boot() { $this->loadViewsFrom(__DIR__ . '/../../views', 'yandex-kassa'); $this->publishes([__DIR__ . '/../../config/yandex_kassa.php' => config_path('yandex_kassa.php')]); $this->publishes([__DIR__ . '/../../database/migrations/' => database_path('/migrations/yandex_kassa')], 'migrations'); include __DIR__ . '/../routes.php'; View::composer(config('yandex_kassa.form_view'), SettingsComposer::class); }
/** * Bootstrap the application services. * * @return void */ public function boot() { View::composer('backend.left-sidebar', function ($view) { $menuItems = new MenuItems(); $menuItems = $menuItems->generate(); $view->with(compact('menuItems')); }); }
/** * Bootstrap the application services. * * @return void */ public function boot() { View::composer(array('welcome', 'profile.profile', 'partials.head_profile', 'calc.index'), 'App\\Composers\\UserComposer'); View::composer(['profile.profile', 'request.create', 'partials.head_profile', 'calc.index'], 'App\\Composers\\PercentComposer'); View::composer(['profile.profile', 'request.create', 'partials.head_profile', 'calc.index'], 'App\\Composers\\CourseComposer'); View::composer('request.create', 'App\\Composers\\DaysComposer'); View::composer('layouts.profile_layout', 'App\\Composers\\ProfileComposer'); View::composer(['profile.profile', 'welcome'], 'App\\Composers\\PlansComposer'); }
/** * Bootstrap the application services. * * @return void */ public function boot() { View::composer('welcome', 'App\\View\\Composers\\AdvComposer'); View::composer(['favorites.index', 'ads.my', 'home'], 'App\\View\\Composers\\AdvComposer'); View::composer('slider.slider', 'App\\View\\Composers\\CategoryComposer'); View::composer('slider.slider', 'App\\View\\Composers\\CityComposer'); View::composer('slider.slider', 'App\\View\\Composers\\TypeComposer'); View::composer('slider.slide', 'App\\View\\Composers\\SliderComposer'); }
/** * Bootstrap any application services. * * @return void */ public function boot() { // View::composer(['front.includes.header'], function ($view) { $model = new Category(); $categories = $model->getCategoryTree(); $view->with('categories', $categories); }); }
/** * Bootstrap the application services. * * @return void */ public function boot() { /** * recibe 2 parametros * 1. la vista o las vistas. * 2. Namespace del view composer */ View::composer(['front.index', 'front.article', 'front.content'], 'App\\Http\\ViewComposers\\AsideComposer'); }
/** * Bootstrap the application events. * * @return void */ public function boot() { // custom namespace $this->package('alexwenzel/laravel-commentary', 'laravel-commentary'); // comment list composer View::composer('laravel-commentary::comment-list', function ($view) { $entity = $view->entity; $comments = Comment::where('entity', $entity)->where('status', Comment::statusApproved)->orderBy('created_at', 'desc')->get(); $view->with('comments', $comments); }); }
/** * Bootstrap the application events. * * @return void */ public function boot() { View::composer('nav', 'App\\Composers\\ViewComposer@navigation'); View::composer('modules.latest-musics', 'App\\Composers\\ViewComposer@latestMusicsModule'); View::composer('modules.latest-videos', 'App\\Composers\\ViewComposer@latestVideosModule'); View::composer('modules.latest-users', 'App\\Composers\\ViewComposer@latestUsersModule'); View::composer('modules.top-musics', 'App\\Composers\\ViewComposer@topMusicsModule'); View::composer('modules.top-videos', 'App\\Composers\\ViewComposer@topVideosModule'); View::composer('modules.top-users', 'App\\Composers\\ViewComposer@topUsersModule'); View::composer('cats.list-cats', 'App\\Composers\\ViewComposer@catModule'); }
private function registerBackendMenu() { $this->app->singleton('menu.backend', function () { return Menu::create('backend'); }); View::composer('vain::admin', function ($view) { $handler = app('menu.backend'); $view->with('menu', $handler); $handler->addChild('admin.menu')->setAttribute('class', 'header'); Event::fire(new BackendMenuCreated($handler, $view)); }); }
/** * Register bindings in the container. * * @return void */ public function boot() { /** * Global */ View::composer('*', GlobalComposer::class); /** * Frontend */ /** * Backend */ }
/** * Register any application services. * * @return void */ public function register() { View::composer('pins.show', function ($view) { if (Auth::check()) { $favorites = DB::table('favorites')->whereUserId(Auth::id())->lists('pin_id'); $view->with('favorites', $favorites); } }); $this->app->singleton('League\\Glide\\Server', function ($app) { $filesystem = $app->make('Illuminate\\Contracts\\Filesystem\\Filesystem'); return \League\Glide\ServerFactory::create(['source' => $filesystem->getDriver(), 'cache' => $filesystem->getDriver(), 'source_path_prefix' => 'images', 'cache_path_prefix' => 'images/.cache', 'base_url' => 'images']); }); }
/** * composes admin views. */ protected function composeViews() { // user menu in app View::composer('app', function ($view) { $view->getFactory()->inject('account', view('user::menu', ['guest' => Auth::guest(), 'user' => Auth::user()])); }); View::composer('admin', function ($view) { // user menu in admin menu $view->getFactory()->inject('account', view('user::admin.partials.account', ['user' => Auth::user()])); // user panel in admin sidebar $view->getFactory()->inject('userpanel', view('user::admin.partials.userpanel', ['user' => Auth::user()])); }); }
/** * Register the application services. * * @return void */ public function register() { View::composer('*', function ($view) { $view->with('current_user', auth()->user()); }); $this->app->bind('App\\Nrgi\\Repositories\\User\\UserRepositoryInterface', 'App\\Nrgi\\Repositories\\User\\UserRepository'); $this->app->bind('App\\Nrgi\\Repositories\\Contract\\ContractRepositoryInterface', 'App\\Nrgi\\Repositories\\Contract\\ContractRepository'); $this->app->bind('App\\Nrgi\\Repositories\\Contract\\Pages\\PagesRepositoryInterface', 'App\\Nrgi\\Repositories\\Contract\\Pages\\PagesRepository'); $this->app->bind('App\\Nrgi\\Repositories\\Contract\\AnnotationRepositoryInterface', 'App\\Nrgi\\Repositories\\Contract\\AnnotationRepository'); $this->app->bind('App\\Nrgi\\Repositories\\ActivityLog\\ActivityLogRepositoryInterface', 'App\\Nrgi\\Repositories\\ActivityLog\\ActivityLogRepository'); $this->app->bind('App\\Nrgi\\Repositories\\Contract\\Comment\\CommentRepositoryInterface', 'App\\Nrgi\\Repositories\\Contract\\Comment\\CommentRepository'); $this->app->bind('App\\Nrgi\\Mturk\\Repositories\\TaskRepositoryInterface', 'App\\Nrgi\\Mturk\\Repositories\\TaskRepository'); $this->app->bind('App\\Nrgi\\Mturk\\Repositories\\Activity\\ActivityRepositoryInterface', 'App\\Nrgi\\Mturk\\Repositories\\Activity\\ActivityRepository'); }
public function __construct() { View::composer('layouts.master', function ($view) { $categories = Category::all(); $view->with(compact('categories')); }); if (Session::has('panier')) { View::composer('layouts.master', function ($view) { $panier = Session::get('panier'); $nbrArticle = 0; foreach ($panier as $key) { $nbrArticle++; } $view->with(compact('nbrArticle')); }); } }
/** * Register the application services. * * @return void */ public function register() { View::composer('*', function ($view) { $view->with('current_user', auth()->user()); }); $this->app->bind('App\\Nrna\\Repositories\\Tag\\TagRepositoryInterface', 'App\\Nrna\\Repositories\\Tag\\TagRepository'); $this->app->bind('App\\Nrna\\Repositories\\Country\\CountryRepositoryInterface', 'App\\Nrna\\Repositories\\Country\\CountryRepository'); $this->app->bind('App\\Nrna\\Repositories\\Question\\QuestionRepositoryInterface', 'App\\Nrna\\Repositories\\Question\\QuestionRepository'); $this->app->bind('App\\Nrna\\Repositories\\Post\\PostRepositoryInterface', 'App\\Nrna\\Repositories\\Post\\PostRepository'); $this->app->bind('App\\Nrna\\Repositories\\Answer\\AnswerRepositoryInterface', 'App\\Nrna\\Repositories\\Answer\\AnswerRepository'); $this->app->bind('App\\Nrna\\Repositories\\CountryUpdate\\UpdateRepositoryInterface', 'App\\Nrna\\Repositories\\CountryUpdate\\UpdateRepository'); $this->app->bind('App\\Nrna\\Repositories\\Journey\\JourneyRepositoryInterface', 'App\\Nrna\\Repositories\\Journey\\JourneyRepository'); $this->app->bind('App\\Nrna\\Repositories\\Place\\PlaceRepositoryInterface', 'App\\Nrna\\Repositories\\Place\\PlaceRepository'); $this->app->bind('App\\Nrna\\Repositories\\CountryTag\\CountryTagRepositoryInterface', 'App\\Nrna\\Repositories\\CountryTag\\CountryTagRepository'); $this->app->bind('App\\Nrna\\Repositories\\ApiLog\\ApiLogRepositoryInterface', 'App\\Nrna\\Repositories\\ApiLog\\ApiLogRepository'); $this->app->bind('App\\Nrna\\Repositories\\User\\UserRepositoryInterface', 'App\\Nrna\\Repositories\\User\\UserRepository'); $this->app->bind('App\\Nrna\\Repositories\\Section\\SectionRepositoryInterface', 'App\\Nrna\\Repositories\\Section\\SectionRepository'); $this->app->bind('App\\Nrna\\Repositories\\CategoryAttribute\\CategoryAttributeRepositoryInterface', 'App\\Nrna\\Repositories\\CategoryAttribute\\CategoryAttributeRepository'); $this->app->bind('App\\Nrna\\Repositories\\Category\\CategoryRepositoryInterface', 'App\\Nrna\\Repositories\\Category\\CategoryRepository'); $this->app->bind('App\\Nrna\\Repositories\\PushNotification\\PushNotificationRepositoryInterface', 'App\\Nrna\\Repositories\\PushNotification\\PushNotificationRepository'); $this->app->bind('App\\Nrna\\Repositories\\Rss\\RssRepositoryInterface', 'App\\Nrna\\Repositories\\Rss\\RssRepository'); $this->app->bind('App\\Nrna\\Repositories\\RssNewsFeeds\\RssNewsFeedsRepositoryInterface', 'App\\Nrna\\Repositories\\RssNewsFeeds\\RssNewsFeedsRepository'); }
<?php use CachetHQ\Cachet\Models\Component; use CachetHQ\Cachet\Models\Incident; use Illuminate\Support\Facades\View; View::composer('index', function ($view) { $date = date('Y-m-d'); $components = Component::notStatus(1); if (Component::all()->count() === 0 || $components->count() === 0) { // If all our components are ok, do we have any non-fixed incidents? $incidents = Incident::orderBy('created_at', 'desc')->get(); $incidentCount = $incidents->count(); if ($incidentCount === 0 || $incidentCount >= 1 && (int) $incidents->first()->status === 4) { $status = 'success'; $message = trans('cachet.service.good'); } else { $status = 'danger'; $message = trans('cachet.service.bad'); } } else { $status = 'danger'; $message = trans('cachet.service.bad'); } $view->with(['systemStatus' => $status, 'systemMessage' => $message]); });
/** * Bootstrap any application services. * * @return void */ public function boot() { View::composer(['helpers.nav'], 'ZaLaravel\\LaravelNavigation\\Composers\\NavigationComposer'); }
protected function registerViewComposer() { View::composer(['checkout.index', 'checkout.shipping-address'], 'Mage2\\Checkout\\ViewComposers\\CheckoutComposer'); }
/** * Bootstrap any application services. * * @return void */ public function boot() { View::composer('*', function ($view) { $view->with('current_user', auth()->user()); }); }
/** * Bootstrap the application services. * * @return void */ public function boot() { View::composer(['ordene.*', 'mail.*', 'inventario.*', 'layouts.principal', 'encomienda.*', 'banco.*', 'configuracion.*', 'migracion.*', 'usuarios.*', 'imagenes.*', 'graciaspago.*'], 'App\\Http\\ViewComposers\\AsideComposer'); }
$view->settingsPrefix = app('admin_config_factory')->getSettingsPrefix(); $view->pagePrefix = app('admin_config_factory')->getPagePrefix(); $view->configType = app()->bound('itemconfig') ? app('itemconfig')->getType() : false; }); //the layout view View::composer(array('administrator::layouts.default'), function ($view) { $view->config = app('itemconfig'); //set up the basic asset arrays $view->css = array(); $view->myjs = array(); $view->js = array('jquery' => '/packages/summerblue/administrator/js/jquery.min.js', 'jquery-migrate' => '/packages/summerblue/administrator/js/jquery-migrate.min.js', 'jquery-ui' => asset('packages/summerblue/administrator/js/jquery/jquery-ui-1.10.3.custom.min.js'), 'customscroll' => asset('packages/summerblue/administrator/js/jquery/customscroll/jquery.customscroll.js')); //add the non-custom-page css assets if (!$view->page && !$view->dashboard) { $view->css += array('jquery-ui' => asset('packages/summerblue/administrator/css/ui/jquery-ui-1.9.1.custom.min.css'), 'jquery-ui-timepicker' => asset('packages/summerblue/administrator/css/ui/jquery.ui.timepicker.css'), 'select2' => asset('packages/summerblue/administrator/js/jquery/select2/select2.css'), 'jquery-colorpicker' => asset('packages/summerblue/administrator/css/jquery.lw-colorpicker.css')); } //add the package-wide css assets $view->css += array('customscroll' => asset('packages/summerblue/administrator/js/jquery/customscroll/customscroll.css'), 'main' => asset('packages/summerblue/administrator/css/main.css'), 'main-extended' => asset('packages/summerblue/administrator/css/main-extended.css')); //add the non-custom-page js assets if (!$view->page && !$view->dashboard) { $view->js += array('select2' => asset('packages/summerblue/administrator/js/jquery/select2/select2.js'), 'jquery-ui-timepicker' => asset('packages/summerblue/administrator/js/jquery/jquery-ui-timepicker-addon.js'), 'ckeditor' => asset('packages/summerblue/administrator/js/ckeditor/ckeditor.js'), 'ckeditor-jquery' => asset('packages/summerblue/administrator/js/ckeditor/adapters/jquery.js'), 'markdown' => asset('packages/summerblue/administrator/js/markdown.js'), 'plupload' => asset('packages/summerblue/administrator/js/plupload/js/plupload.full.js')); $view->myjs += array('ckeditor' => asset('packages/summerblue/administrator/js/ckeditor/ckeditor.js'), 'ckeditor-jquery' => asset('packages/summerblue/administrator/js/ckeditor/adapters/jquery.js'), 'plupload' => asset('packages/summerblue/administrator/js/plupload/js/plupload.full.js')); //localization js assets $locale = config('app.locale'); if ($locale !== 'en') { $view->myjs += array('plupload-l18n' => asset('packages/summerblue/administrator/js/plupload/js/i18n/' . $locale . '.js'), 'timepicker-l18n' => asset('packages/summerblue/administrator/js/jquery/localization/jquery-ui-timepicker-' . $locale . '.js'), 'datepicker-l18n' => asset('packages/summerblue/administrator/js/jquery/i18n/jquery.ui.datepicker-' . $locale . '.js'), 'select2-l18n' => asset('packages/summerblue/administrator/js/jquery/select2/select2_locale_' . $locale . '.js')); } //remaining js assets $view->js += array('knockout' => asset('packages/summerblue/administrator/js/knockout/knockout-2.2.0.js'), 'knockout-mapping' => asset('packages/summerblue/administrator/js/knockout/knockout.mapping.js'), 'knockout-notification' => asset('packages/summerblue/administrator/js/knockout/KnockoutNotification.knockout.min.js'), 'knockout-update-data' => asset('packages/summerblue/administrator/js/knockout/knockout.updateData.js'), 'knockout-custom-bindings' => asset('packages/summerblue/administrator/js/knockout/custom-bindings.js'), 'accounting' => asset('packages/summerblue/administrator/js/accounting.js'), 'colorpicker' => asset('packages/summerblue/administrator/js/jquery/jquery.lw-colorpicker.min.js'), 'history' => asset('packages/summerblue/administrator/js/history/native.history.js'), 'admin' => asset('packages/summerblue/administrator/js/admin.js'), 'settings' => asset('packages/summerblue/administrator/js/settings.js')); } $view->js += array('page' => asset('packages/summerblue/administrator/js/page.js')); });
/** * Bootstrap any application services. * * @return void */ public function boot() { View::composer('laravel-admin::layout', 'ZaLaravel\\LaravelAdmin\\Composers\\LayoutComposer'); }
private function buildComposers() { $template_path = url('/') . Config::get('pragmarx/tracker::stats_template_path'); View::composer('pragmarx/tracker::*', function ($view) use($template_path) { $view->with('stats_template_path', $template_path); }); }