/** * Applies site wide variables to main layout. * * @param $view */ public function compose(View $view) { $siteTitle = $this->config->get('site.title.main'); $currentUser = $this->sentry->getCurrentUser(); $view->with('siteTitle', $siteTitle); $view->with('currentUser', $currentUser); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { if ($this->auth->check()) { $view->with('auth', $this->user); $view->with('dashboard', $this->dashboardService->dashboard()); } }
/** * @param View $view */ public function compose(View $view) { $view->with('currentUser', $this->sentinel->getUser()); $view->with('mode', array_get($view->getData(), 'mode', '')); $view->with('breadcrumbs', config('shapeshifter.breadcrumbs') ? $this->breadcrumbService->breadcrumbs() : []); $view->with('menu', $this->menuService->generateMenu()); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $view->with('productsCount', $this->getProductsCount()); $view->with('usersCount', $this->getUsersCount()); $view->with('subscribersCount', $this->getSubscribersCount(app(SubscribersCache::class))); $view->with('visitors', $this->getUniqueVisitorsCount()); $view->with('dashboardGraph', $this->getDashboardGraph()); }
/** * Execute an action on the controller. * * @param string $method * @param array $parameters * @return \Symfony\Component\HttpFoundation\Response */ public function callAction($method, $parameters) { $this->setupLayout(); $response = call_user_func_array(array($this, $method), $parameters); if ($response instanceof View && !$this->layout->offsetExists('content')) { return $this->layout->with('content', $response); } return $response; }
/** * @param \Illuminate\View\View $view */ protected function addViewDefaults(\Illuminate\View\View $view) { if ($title = $view->title) { $title .= ' – '; } $title .= $this->admin->title; $view->with('pageTitle', $title); $view->with('adminTitle', $this->admin->title); }
/** * @param $view */ public function compose(View $view) { $viewData = $view->getData(); $date = array_has($viewData, 'date') && $viewData['date'] ? $viewData['date'] : Carbon::today(); $calendar = $this->manager->getCalendar(Carbon::today()); $lastBillboard = $this->billboardsRepository->findNewer(); $view->with('calendar', $calendar); $view->with('date', $date); $view->with('lastBillboard', $lastBillboard); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $tasks = $this->tasks->find($view->getData()['tasks']['id']); /** * [User assigned the task] * @var contact */ $contact = $tasks->assignee; $client = $tasks->clientAssignee; $view->with('contact', $contact); $view->with('client', $client); }
/** * Compose the View * * @param View $view * * @return mixed */ public function compose(View $view) { // check if any args to be provided by extending classes are provided $this->checkArguments(); $key = h($this->outputVariable); if ($this->cache->has($key)) { $view->with($this->outputVariable, $this->cache->get($key)); } else { $data = $this->getData(); $this->cache->put($key, $data); $view->with($this->outputVariable, $data); } }
public function compose(View $view) { if (self::$cart) { $view->with('cart', self::$cart); return; } $cart = []; if (Auth::check()) { $items = app(CartManager::class)->getItemsForUserGroupedBySeller(Auth::user()); $cart = ['count' => $items->totalCount(), 'items' => $items]; } $view->with('cart', self::$cart = $cart); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $client = new Client(); try { $response = $client->get('http://logger.witr.rit.edu/latest.json', ['timeout' => 1]); return $view->with('nowplaying', $response->json(['object' => true])); } catch (RequestException $e) { $data = new stdClass(); $data->artist = ''; $data->title = 'Not Available'; return $view->with('nowplaying', $data); } }
/** * @param View $view */ public function address($view) { $viewData = $view->getData(); $address = ['id' => '', 'address1' => '', 'address2' => '', 'address3' => '', 'city' => '', 'state' => '', 'postcode' => '', 'countryId' => '']; if (isset($viewData['address']) && $viewData['address']) { foreach ($viewData['address'] as $key => $value) { $address[$key] = $value; } } $view->with('address', $address); if (!isset($viewData['prefix'])) { $view->with('prefix', ''); } }
public function compose(View $view) { $mainMenu = $this->pages->with('translation')->whereHas('menuPositions', function ($query) { $query->where('id', 2); })->get()->toHierarchy(); $view->with('mainMenu', $mainMenu); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $cart = count(Session::get('cart')); $categoryModel = new Category(); $baseCategories = $categoryModel->getAllCategories(); $view->with('categories', $baseCategories)->with('cart', $cart); }
public function prepare(View $view, array $parameters) { //dd($parameters); //grab the single post that match's the id in the parameters or routing data sent $post = $this->posts->where('id', $parameters['id'])->where('slug', $parameters['slug'])->first(); $view->with('post', $post); }
public function compose(View $view) { $documentForm = \Request::only('responsable_id'); $route = Route::currentRouteName(); $users = User::orderBy('name', 'ASC')->lists('name', 'id')->toArray(); $view->with(compact('documentForm', 'users', 'route')); }
/** * @param View $view */ public function compose(View $view) { if ($view->offsetExists('revision')) { $revision = $view->offsetGet('revision'); } else { if ($view->offsetExists('law')) { $law = $view->offsetGet('law'); $revision = $law->active_revision()->first(); } else { abort(404, 'No law or revision passed.'); } } $is_raw = $view->offsetExists('raw') && $view->offsetGet('raw'); $view->with('meta', $this->getLawMetaData($revision)); $view->with('text', $this->getLawText($revision, $is_raw)); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $productAttrobuteModel = new ProductAttribute(); $isFeaturedOptions = $productAttrobuteModel->getIsFeaturedOptions(); $statusOptions = $productAttrobuteModel->getStatusOptions(); $view->with('isFeaturedOptions', $isFeaturedOptions)->with('statusOptions', $statusOptions); }
/** * Bind data to the view. * * @param View $view */ public function create(View $view) { if ($this->googleTagManager->isEnabled() && empty($this->googleTagManager->id())) { throw new ApiKeyNotSetException(); } $view->with('enabled', $this->googleTagManager->isEnabled())->with('id', $this->googleTagManager->id())->with('dataLayer', $this->googleTagManager->getDataLayer()); }
/** * Add a piece of data to the view. * * @param string|array $key * @param mixed $value * @return \Illuminate\View\View */ public function with($key, $value = null) { if (is_array($key)) { return parent::with($this->factory->decorate($key)); } return parent::with($key, $this->factory->decorate($value)); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $user = Cache::remember('user', 1440, function () { return Auth::user(); }); $view->with('user', $user); }
/** * Bind data to the view. * * @param View $view * * @return void */ public function compose(View $view) { $contactKey = session('contact_key'); if (!$contactKey) { return false; } $contact = Contact::where('contact_key', '=', $contactKey)->with('client')->first(); if (!$contact || $contact->is_deleted) { return false; } $client = $contact->client; $hasDocuments = DB::table('invoices')->where('invoices.client_id', '=', $client->id)->whereNull('invoices.deleted_at')->join('documents', 'documents.invoice_id', '=', 'invoices.id')->count(); $view->with('hasQuotes', $client->quotes->count()); $view->with('hasCredits', $client->creditsWithBalance->count()); $view->with('hasDocuments', $hasDocuments); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { if ($this->shows == null) { $this->shows = Show::orderBy('name', 'asc')->get(); } $view->with('shows', $this->shows); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $user = $this->user->find($this->user_auth->id); $notifications = $user->notifications()->noread()->get(); $notificationsCount = $notifications->count(); $view->with(['notifications' => $notifications, 'notificationsCount' => $notificationsCount]); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { if ($this->djs == null) { $this->djs = DJ::orderBy('name', 'asc')->get(); } $view->with('djs', $this->djs); }
/** * Bind data to the view. * * @param View $view * * @return void */ public function compose(View $view) { $locale = app()->getLocale(); $filename = Request::route()->getName() . '.md'; $filepath = 'userhelp' . DIRECTORY_SEPARATOR . $locale . DIRECTORY_SEPARATOR . $filename; $help = Storage::exists($filepath) ? Markdown::convertToHtml(Storage::get($filepath)) : ''; $view->with('help', $help); }
/** * composing the view * * @param \Illuminate\View\View $view */ public function compose(\Illuminate\View\View $view) { $notifications = []; if (null !== ($user = $this->authManager->user())) { $notifications = $this->notificationManager->getForUser($user, [NotificationActivity::CREATED, NotificationActivity::READ]); } $view->with('notifications', $notifications); }
public function compose(View $view) { $sessionId = session()->getId(); $sessionCartItems = $this->sessionCartRepo->getCartItemsNumber($sessionId); $sessionCart = $this->sessionCartRepo->getCartBySessionId($sessionId); $totals = $this->sessionCartRepo->calculateTotalBySessionId($sessionCart); $view->with('cart_items_number', $sessionCartItems)->with('cart_items_transport_fee', $totals['transportFee'])->with('cart_items_total', $totals['total']); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $productAttrobuteModel = new ProductAttribute(); $trackStockOptions = $productAttrobuteModel->getTrackStockOptions(); $inStockOptions = $productAttrobuteModel->getInStockOptions(); $isTaxableOptions = $productAttrobuteModel->getIsTaxableOptions(); $view->with('isTaxableOptions', $isTaxableOptions)->with('trackStockOptions', $trackStockOptions)->with('inStockOptions', $inStockOptions); }
/** * @param $view * * @return mixed */ public function compose(View $view) { $priorities = $this->priority->all()->lists('name', 'id')->toArray(); /* * Default selected None value */ $priorities[null] = 'Select a Priority'; return $view->with('priorities', $priorities); }