/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { // Retrieve all categories $categories = Category::all(); // Bind them to view $view->with('categories', $categories); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $empresaslista = Empresa::orderBy('nombre', 'ASC')->lists('nombre', 'nombre'); $localidades = Localidad::orderBy('nombre', 'ASC')->lists('nombre', 'id'); $rubros = Rubro::orderBy('nombre', 'ASC')->lists('nombre', 'id'); $view->with('rubros', json_decode($rubros, true))->with('empresaslista', json_decode($empresaslista, true))->with('localidades', json_decode($localidades, true)); }
/** * Bind data to the view. * * @param \Illuminate\Contracts\View\View $view */ public function compose(View $view) { $view->withIssueCount(Issue::all()->count()); $view->withProjectCount(Project::all()->count()); $view->withGroupCount(Group::count()); $view->withMomentCount(Moment::all()->count()); }
public function compose(View $view) { if ($view->getName() == 'frontend.property.compare_bar') { $propertiesInComparison = PropertyCompareHelper::getCurrentList(); $view->with('propertiesInComparison', $propertiesInComparison); } }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { //$notifacations = DB::table('notifacations')->where('userID', Auth::user()->id)->get(); $notifacationsCount = DB::table('notifacations')->where('userID', Auth::user()->id)->count(); //$view->with('notifacations', $notifacations); $view->with('notifacationsCount', $notifacationsCount); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { if (!Cache::get('popular_categories')) { Cache::put('popular_categories', $this->categories->getPopular(), 60); } $view->with('popular_categories', Cache::get('popular_categories')); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $menu = new Menu('ul', 'nav navbar-nav'); $menu->addItem(new MenuItem('#page-top', trans('pages.home_title'), 'li', 'hidden', 'page-scroll')); $menu = content_filter('main_menu', $menu); $view->with('main_menu', $menu); }
public function compose(View $view) { $categories = Cache::remember('categories', 1440, function () { return Category::orderBy('name')->get(); }); $view->with(['user' => $this->auth->user(), 'categories' => $categories, 'guest' => !$this->auth->check()]); }
/** * Index page view composer. * * @param \Illuminate\Contracts\View\View $view * * @return void */ public function compose(View $view) { $isEnabled = (bool) Setting::get('enable_subscribers', false); $mailAddress = env('MAIL_ADDRESS', false); $mailFrom = env('MAIL_NAME', false); $view->withSubscribersEnabled($isEnabled && $mailAddress && $mailFrom); }
/** * Bind data to the view. * * @param View $view * @return void */ public function create(View $view) { // request the Client translations $clients = [Lang::get('labels.enter.Client')] + $this->clientController->lists('Client_Name'); //dd(__METHOD__."(".__LINE__.")",compact('clients')); $view->with('clients', $clients); }
/** * Bind data to the view. * * @param View $view * @return void */ public function create(View $view) { // request the UOM translations $uoms = [Lang::get('labels.enter.UOM')] + $this->uomController->translate('Uom'); //dd(__METHOD__."(".__LINE__.")",compact('uoms')); $view->with('uoms', $uoms); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $productoslista = Producto::orderBy('nombre', 'ASC')->searchActivos()->lists('nombre', 'nombre'); $marcas = Marca::orderBy('nombre', 'ASC')->searchActivos()->lists('nombre', 'id'); $tipos = Tipoproducto::orderBy('nombreTipo', 'ASC')->lists('nombreTipo', 'id'); $view->with('marcas', json_decode($marcas, true))->with('tipos', json_decode($tipos, true))->with('productoslista', json_decode($productoslista, true)); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { if (!Cache::get('recent_posts')) { Cache::put('recent_posts', $this->posts->getAll('published', null, 'published_at', 'desc', 5), 10); } $view->with('recent_posts', Cache::get('recent_posts')); }
/** * Bind data to the view. * * @param View $view * * @return void */ public function compose(View $view) { if ($view->group_form_errors and $view->errors->any()) { $view->nest('form_error_content', $view->bsb_pkg_ref . '::form.control.errors', ['errors' => $view->errors->all()]); } foreach ($view->groups as $name => &$input) { if (is_array($input)) { if (count(array_filter(array_keys($input), 'is_string'))) { //The array contains named keys, generate inputs from these options $view_name = $view->bsb_pkg_ref . '::input.' . (empty($input['type']) ? 'text' : $input['type']); if (!view()->exists($view_name)) { $view_name = $view->bsb_pkg_ref . '::input.' . 'text'; } $input = view($view_name, array_merge(compact('name'), $input), $view->getData()); } else { //The array contains html strings, display them together within a form-group $input = view($view->bsb_pkg_ref . '::input.group', ['content' => implode("\n", $input)], $view->getData()); } } elseif (!str_contains($input, '.form-group')) { //The input is just a string of html, but it doesn't contain any .form-group element, so we'll wrap it in one $input = view($view->bsb_pkg_ref . '::input.group', ['content' => $input], $view->getData()); } } //TODO: add form-horizontal and form-inline options }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $user = $this->user; $travelOrderCount = 0; $regularLeaveCount = 0; $specialLeaveCount = 0; if ($user->employee && $user->employee->canApproveRegularLeave()) { $regularLeaveCount = $user->employee->regular_leave_recommending_approvals->merge($user->employee->regular_leave_approved_by)->count(); } if ($user->employee && $user->employee->canApproveSpecialLeave()) { $specialLeaveCount = $user->employee->special_leave_recommending_approvals->merge($user->employee->special_leave_approved_by)->count(); } if ($user->isAdmin()) { $regularLeaveCount = EmployeeLeave::approved()->count(); $specialLeaveCount = EmployeeSpecialLeave::approved()->count(); } if ($user->employee && $user->employee->canApproveTravelOrder()) { if ($user->isFinanceDirector()) { $travelOrderCount = TravelOrder::recommended()->count(); } else { $travelOrderCount = $user->employee->travel_order_recommending_approvals->merge($user->employee->travel_order_approved_by)->count(); } } $view->with(compact('user', 'regularLeaveCount', 'specialLeaveCount', 'travelOrderCount')); }
public function compose(View $view) { $program_array = $this->programRepo->getDropDownArray(); unset($program_array['Cosmetology Operator']); unset($program_array['Cosmetology Teacher']); $view->with('programs', $program_array); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { if (!Auth::guest()) { $n = Notification::byUser(Auth::user())->unread()->get(); $view->with('notifications', ['count' => $n->count(), 'notifications' => $n]); } }
/** * * return the path of the actually view * * @return string * @throws ViewException */ public function getPath() { if (is_null($this->view)) { throw new ViewException('View is not defined'); } return $this->view->getPath(); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { // Retrieve all pages $pages = Page::all(); // Bind them to view $view->with('pages', $pages); }
/** * Bind data to the view. * * @param View $view * * @return void */ public function compose(View $view) { $summary = $this->getCharacterInformation($this->request->character_id); $characters = $this->getCharactersOnApiKey($summary->keyID); $view->with('summary', $summary); $view->with('characters', $characters); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $view->with('heder', view('admin.header')); $tables = new Cms_tables(); $activeTable = $tables->getActiveTables(); $view->with('left_column', view('admin.left_colum', ['tables' => $activeTable])); }
/** * Bind data to the view. * * @param View $view */ public function compose(View $view) { $roles = Auth::user()->company->roles->lists('name', 'id')->all(); $areas = Auth::user()->company->areas->lists('name', 'id')->all(); $categories = Auth::user()->company->categories->lists('name', 'id')->all(); $view->with(['roles' => $roles, 'areas' => $areas, 'categories' => $categories]); }
/** * Composer for the main navigation * * @param View $view */ public function compose(View $view) { $view->with('logged_in', \Auth::check()); if (\Auth::check()) { $view->with('logged_user', \Auth::user()); } }
/** * Compose the view. * * @return void */ public function compose(View $view) { $value = Cache::remember('users', 3, function () { return DB::table('users')->get(); }); $view->with('tags', Tags::all())->with('categories', Category::all()); }
/** * Bind data to the view. * * @param View $view * @return void */ public function create(View $view) { // request the Permission translations $permissions = [Lang::get('labels.enter.Permission')] + $this->permissionController->translate('display_name'); //dd(__METHOD__."(".__LINE__.")",compact('permissions')); $view->with('permissions', $permissions); }
/** * Index page view composer. * * @param \Illuminate\Contracts\View\View $view * * @return void */ public function compose(View $view) { $totalComponents = Component::enabled()->count(); $majorOutages = Component::enabled()->status(4)->count(); $isMajorOutage = $majorOutages / $totalComponents >= 0.5; // Default data $withData = ['system_status' => 'info', 'system_message' => trans_choice('cachet.service.bad', $totalComponents), 'favicon' => 'favicon-high-alert']; if ($isMajorOutage) { $withData = ['system_status' => 'danger', 'system_message' => trans_choice('cachet.service.major', $totalComponents), 'favicon' => 'favicon-high-alert']; } elseif (Component::enabled()->notStatus(1)->count() === 0) { // If all our components are ok, do we have any non-fixed incidents? $incidents = Incident::notScheduled()->orderBy('created_at', 'desc')->get(); $incidentCount = $incidents->count(); if ($incidentCount === 0 || $incidentCount >= 1 && (int) $incidents->first()->status === 4) { $withData = ['system_status' => 'success', 'system_message' => trans_choice('cachet.service.good', $totalComponents), 'favicon' => 'favicon']; } } else { if (Component::enabled()->whereIn('status', [2, 3])->count() > 0) { $withData['favicon'] = 'favicon-medium-alert'; } } // Scheduled maintenance code. $scheduledMaintenance = Incident::scheduled()->orderBy('scheduled_at')->get(); // Component & Component Group lists. $usedComponentGroups = Component::enabled()->where('group_id', '>', 0)->groupBy('group_id')->pluck('group_id'); $componentGroups = ComponentGroup::whereIn('id', $usedComponentGroups)->orderBy('order')->get(); $ungroupedComponents = Component::enabled()->where('group_id', 0)->orderBy('order')->orderBy('created_at')->get(); $view->with($withData)->withComponentGroups($componentGroups)->withUngroupedComponents($ungroupedComponents)->withScheduledMaintenance($scheduledMaintenance); }
/** * Share the user information to View * * @param View $view * @return void */ public function compose(View $view) { $currentUser = $this->user->getCurrentUser(); if (!empty($currentUser)) { $view->with('User', $currentUser); } }
/** * Composer for showing a user * * @param View $view */ public function compose(View $view) { $user = $view->getData()['user']; $view->with('user_courses', \User::userCoursesPaginate($user)); $view->with('user_courses_count', \User::countUserCourses($user)); $view->with('count_followers', \User::countFollowers($user)); }
/** * Compose the view. * * @param \Illuminate\Contracts\View\View $view */ public function compose(View $view) { $users = $this->prepareUsersData($start = Carbon::now()->subMonth(1)->setTime(0, 0), $end = Carbon::now()->setTime(23, 59, 59)); $view->with('latestUsersByThirtyDays', $this->getDatesRange($start, $end)->transform(function ($date) use($users) { return $users->get($date, new Collection())->count(); })); }
public function compose(View $view) { $categories = \App\Models\Categories::i()->withPostsCount(); $posts_count = \App\Models\Posts::active()->count(); $view->with('categories', $categories); $view->with('posts_count', $posts_count); }