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')); }
/** * 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()); } }
/** * Add a View instance to the Collector * * @param \Illuminate\View\View $view */ public function addView(View $view) { $name = $view->getName(); $path = $view->getPath(); if (!is_object($path)) { if ($path) { $path = ltrim(str_replace(base_path(), '', realpath($path)), '/'); } if (substr($path, -10) == '.blade.php') { $type = 'blade'; } else { $type = pathinfo($path, PATHINFO_EXTENSION); } } else { $type = get_class($view); $path = ''; } if (!$this->collect_data) { $params = array_keys($view->getData()); } else { $data = array(); foreach ($view->getData() as $key => $value) { $data[$key] = $this->exporter->exportValue($value); } $params = $data; } $this->templates[] = array('name' => $path ? sprintf('%s (%s)', $name, $path) : $name, 'param_count' => count($params), 'params' => $params, 'type' => $type); }
/** * 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); }
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) { if ($this->djs == null) { $this->djs = DJ::orderBy('name', 'asc')->get(); } $view->with('djs', $this->djs); }
/** * Add a View instance to the Collector * * @param \Illuminate\View\View $view */ public function addView(View $view) { $name = $view->getName(); $path = $view->getPath(); if ($path) { $path = ltrim(str_replace(base_path(), '', realpath($path)), '/'); } if (substr($path, -10) == '.blade.php') { $type = 'blade'; } else { $type = pathinfo($path, PATHINFO_EXTENSION); } if (!$this->collect_data) { $params = array_keys($view->getData()); } else { $data = array(); foreach ($view->getData() as $key => $value) { if (in_array($key, ['__env', 'app', 'errors', 'obLevel', 'currentUser'])) { continue; } $data[$key] = $this->exportValue($value); } $params = $data; } $this->templates[] = array('name' => $path ? sprintf('%s (%s)', $name, $path) : $name, 'param_count' => count($params), 'params' => $params, 'type' => $type); }
/** * 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); }
/** * 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()); }
/** * 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); }
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); }
/** * 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) { $user = Cache::remember('user', 1440, function () { return Auth::user(); }); $view->with('user', $user); }
/** * Set the content for the reponse. * * @return \Illuminate\View\View */ public function setContent($view, $data = []) { if (!is_null($this->layout)) { return $this->layout->nest('content', $view, $data); } return view($view, $data); }
/** * 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); }
/** * Use this in your templates to render views returned by the controllers * * @param \Illuminate\View\View $view The view to be rendered */ public static function render($view) { try { echo $view->render(); } catch (\Exception $e) { echo $e->getMessage(); } }
/** * 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) { $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); }
/** * 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); }
/** * 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 $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); }
/** * Publish a source file and/or pass to $next. * * @param Source $source * @param Closure $next * @param array $extensions * @return mixed */ public function handle(Source $source, Closure $next, ...$extensions) { if ($this->isPublishable($source, $extensions)) { $view = new View($this->factory, $this->factory->getEngineFromPath($source->getPathname()), $this->files->get($source->getPathname()), $source->getPathname()); $source->changeExtension(['.blade.php' => '.html'])->changeExtension(['.php' => '.html']); $this->write($source->getOutputPathname(), $view->render()); } $next($source); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $user = $this->user->find($this->user_auth->id); $alerts = $user->tasks()->outtime()->nodone()->get(); $alertsCount = $alerts->count(); $tasks = $user->tasks()->nodone()->get(); $tasksCount = $tasks->count(); $view->with(['tasksCount' => $tasksCount, 'tasks' => $tasks, 'alerts' => $alerts, 'alertsCount' => $alertsCount]); }
/** * @param $view * * @return mixed */ public function compose(View $view) { $statuses = $this->status->all()->lists('name', 'id')->toArray(); /* * Default selected None value */ $statuses[null] = 'Select a Status'; return $view->with('statuses', $statuses); }
/** * Bind data to the view. * * @param \Illuminate\View\View $view */ public function compose(View $view) { foreach (config('arcanesoft.foundation.sidebar.items', []) as $sidebarKey) { if (config()->has($sidebarKey)) { $this->sidebar->add(config($sidebarKey)); } } $this->sidebar->setCurrent(Arr::get($view->getData(), 'current_page', '')); }
/** * @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); }
public function compose(View $view) { if (!Auth::check()) { $newConversationsCount = 0; } else { $newConversationsCount = account()->participations()->unread()->count(); } $view->with(compact('newConversationsCount')); }
public function compose(View $view) { if (Auth::check()) { $auth = view('auth.authuser'); } else { $auth = view('auth.noneauthuser'); } $view->with('auth', $auth); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $clients = $this->clients->find($view->getData()['client']['id']); /** * [User assigned the client] * @var contact */ $contact = $clients->userAssignee; $view->with('contact', $contact); }