/** * Bind data to the view. * * @param View $view * * @return void */ public function compose(View $view) { $data = $view->getData(); if (Auth::check()) { $notifications = Auth::user()->notifications()->with('user')->orderBy('created_at', 'desc')->take(15)->get(); $view->with('notifications', $notifications); $unreadCount = Auth::user()->notifications()->wherePivot('read', false)->count(); $view->with('newNotificationsCount', $unreadCount); } // Get object from which we can extract name to use as page title $currentGroup = head(array_only($data, ['group', 'folder', 'fakeGroup'])); $view->with('currentGroup', $currentGroup); if (isset($currentGroup) && isset($currentGroup->name)) { $pageTitle = $currentGroup->name; // Homepage title shall always be Strimoid.pl if ($currentGroup->urlname == 'all' && !Setting::get('homepage_subscribed', false)) { $pageTitle = 'Strimoid'; } if ($currentGroup->urlname == 'subscribed' && Setting::get('homepage_subscribed', false)) { $pageTitle = 'Strimoid'; } } else { $pageTitle = 'Strimoid'; } $view->with('pageTitle', $pageTitle); // Needed by top bar with groups $popularGroups = Cache::remember('popularGroups', 60, function () { return Group::orderBy('subscribers_count', 'desc', true)->take(30)->get(['id', 'name', 'urlname']); }); $view->with('popularGroups', $popularGroups); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $view->with('disposition_check', ['use as is', 'ncmr#', 'rework', 'split lot', 'shutdown', 'shipback']); $view->with('cod_check', ['production', 'process', 'maintenance', 'facilities', 'quality assurance', 'others']); $view->with('approvers', ['production', 'process', 'quality assurance', 'others']); $view->with('names', Employee::select('name')->orderBy('name')->where('name', '<>', Auth::User()->employee->name)->get()); }
/** * 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)); }
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); }
/** * 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()); } }
/** * 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])); }
public function compose(View $view) { $this->post = $view->offsetGet('post'); $embedHtml = $this->getEmebdHtml(); $previousVoteValue = $this->getPreviousVoteValue(); $view->with('previousVoteValue', $previousVoteValue); $view->with('embedHtml', $embedHtml); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $network_id = config('yppmembers.network_id'); $network = Network::find($network_id); $page_title = $network->name; $view->with('network', $network); $view->with('support_url', config('yppmembers.support_url')); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { // If you want the wiki post dropown menu to show, this $post is required. $post = Mrcore::post()->prepare(); $view->with('post', $post); $view->with('navTitle', 'Navigation'); $view->with('navItems', array(['key' => 'dashboard', 'display' => 'Dashboard'], ['key' => 'menuitem1', 'display' => 'MenuItem 1', 'url' => ''], ['key' => 'menuitem2', 'display' => 'MenuItem 2', 'subnav' => array(['key' => 'submenuitem1', 'display' => 'Sub MenuItem 1', 'url' => ''], ['key' => 'submenuitem2', 'display' => 'Sub MenuItem 2', 'url' => ''])])); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $view->with('select_failure_mode', ['Assembly', 'Environment', 'Machine', 'Man', 'Material', 'Method / Process']); $view->with('customers', Option::orderBy('customer')->select('customer')->get()); $view->with('machines', Machine::orderBy('name')->select('name')->get()); $view->with('stations', Station::select('station')->get()); $view->with('employees', Employee::orderBy('name')->select('name')->where('name', '<>', Auth::user()->employee->name)->get()); }
/** * Generates the pending and deploying projects for the view. * * @param \Illuminate\Contracts\View\View $view * @return void */ public function compose(View $view) { $pending = $this->deploymentRepository->getPending(); $view->with('pending', $pending); $view->with('pending_count', count($pending)); $deploying = $this->deploymentRepository->getRunning(); $view->with('deploying', $deploying); $view->with('deploying_count', count($deploying)); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $user = Auth::user(); if (!empty($user)) { $view->with('user', $user->getValues()); } else { $view->with('user', []); } }
public function compose(View $view) { $view->with('websiteTitle', app('typicms')->title()); $navbar = false; if (auth()->user() && (auth()->user()->hasAnyRole(['administrator', 'editor']) || auth()->user()->isSuperUser()) && !request()->input('preview')) { $navbar = true; } $view->with('navbar', $navbar); }
public function compose(View $view) { $setting = Setting::orderBy('created_at', 'DESC')->first(); if (!is_null($setting)) { $view->with('app_title', $setting->name); } else { $view->with('app_title', 'Default App Title'); } }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $network_id = config('yppmembers.network_id'); $network = Network::find($network_id); $network_sites = $network->sites()->withcontent()->orderBy('name', 'asc')->get(); $most_used_tags_in_network = Tag::ofNetwork($network->id)->mostUsedInNetwork($network->id)->take(20)->get(); $most_used_models_in_network = Model::ofNetwork($network->id)->mostUsedInNetwork($network->id)->take(20)->get(); $view->with('network_sites', $network_sites); $view->with('most_used_tags_in_network', $most_used_tags_in_network); $view->with('most_used_models_in_network', $most_used_models_in_network); }
public function compose(View $view) { $user = \Auth::user(); $view->with('user', $user); $profile_pic = 'avatar3.png'; if ($user->profile_id) { $view->with('profile_pic', \Gander\Profile::find($user->profile_id)->pic); } else { $view->with('profile_pic', $profile_pic); } }
/** * Bind data to the view. * * @param \Illuminate\Contracts\View\View $view */ public function compose(View $view) { $view->with('themeBackgroundColor', Setting::get('style_background_color')); $view->with('themeTextColor', Setting::get('style_text_color')); $viewData = $view->getData(); $themeView = array_only($viewData, preg_grep('/^theme/', array_keys($viewData))); $hasThemeSettings = array_filter($themeView, function ($data) { return $data != null; }); $view->with('themeSetup', !empty($hasThemeSettings)); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { //Log::info($this->request->path()); $target_auth_url = url('login'); $target_auth_label = trans('texts.login'); if (strtolower($this->request->path()) === 'login') { $target_auth_url = url('register'); $target_auth_label = trans('texts.register'); } $view->with('target_auth_url', $target_auth_url); $view->with('target_auth_text', $target_auth_label); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { // Available languages $view->with('languages', $languages = Language::orderBy('name')->get()); // Available languages but current one $appLanguage = app('language'); $view->with('languagesButCurrent', $languages->filter(function ($l) use($appLanguage) { return $l->id != $appLanguage->id; })); // All languages //$view->with('allLanguages', Language::orderBy('name')->withTrashed()->get()); }
/** * Generates the group listing for the view. * * @param View $view */ public function compose(View $view) { $active_group = null; $active_project = null; if (isset($view->project) && !$view->project->is_template) { $active_group = $view->project->group_id; $active_project = $view->project->id; } $view->with('active_group', $active_group); $view->with('active_project', $active_project); $view->with('groups', $this->groupRepository->getAll()); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $professions = $this->profession->getAll(); $cantons = $this->canton->getAll(); $pays = $this->pays->getAll(); $members = $this->member->getAll(); $specialisations = $this->specialisation->getAll(); $view->with('pays', $pays); $view->with('cantons', $cantons); $view->with('professions', $professions); $view->with('members', $members); $view->with('specialisations', $specialisations); }
public function compose(View $view) { $voteValue = 0; $comment = $view->getData()['comment']; if (Auth::check()) { $votes = $comment->votes()->where('user_id', Auth::id()); if ($votes->count() > 0) { $voteValue = $votes->first()->value; } } $view->with('voteValue', $voteValue); $view->with('score', $comment->votes()->sum('value')); }
/** * Determines if the update prompt should show. * * @param View $view */ public function compose(View $view) { $latest_tag = $this->release->latest(); $current = Version::parse(APP_VERSION); $latest = Version::parse(APP_VERSION); if ($latest_tag) { $latest = Version::parse($latest_tag); } $is_outdated = $latest->compare($current) === 1; $view->with('is_outdated', $is_outdated); $view->with('current_version', $current); $view->with('latest_version', $latest); }
/** * Generates the group listing for the view. * * @param \Illuminate\Contracts\View\View $view * @return void */ public function compose(View $view) { $active_group = null; $active_project = null; if (isset($view->project) && !$view->project->is_template) { $active_group = $view->project->group_id; $active_project = $view->project->id; } $groups = Group::where('id', '<>', Template::GROUP_ID)->orderBy('name')->get(); $view->with('active_group', $active_group); $view->with('active_project', $active_project); $view->with('groups', $groups); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $view->with('charts', [['heading' => 'QDN METRICS <br> ', 'id' => 'modalQdnMetrics', 'title' => '', 'graph' => 'qdnMetricsGraph', 'table' => 'qdnMetricsTable'], ['heading' => 'PARETO OF DISCREPANCY <br> ', 'id' => 'pod', 'title' => '', 'graph' => 'podGraph', 'table' => 'podTable'], ['heading' => 'PARETO OF DISCREPANCY <br> ( FAILURE MODE )', 'id' => 'failureModeModal', 'title' => 'Pareto of Discrepancy - FAILURE MODE ', 'graph' => 'failureModeGraph', 'table' => 'failureModeTable'], ['heading' => 'PARETO OF DISCREPANCY <br> ( ASSEMBLY )', 'id' => 'assemblyModal', 'title' => 'Pareto of Discrepancy - ASSEMBLY ', 'graph' => 'assemblyGraph', 'table' => 'assemblyTable'], ['heading' => 'PARETO OF DISCREPANCY <br> ( ENVIRONMENT )', 'id' => 'environmentModal', 'title' => 'Pareto of Discrepancy - ENVIRONMENT ', 'graph' => 'environmentGraph', 'table' => 'environmentTable'], ['heading' => 'PARETO OF DISCREPANCY <br> ( MACHINE )', 'id' => 'machineModal', 'title' => 'Pareto of Discrepancy - MACHINE ', 'graph' => 'machineGraph', 'table' => 'machineTable'], ['heading' => 'PARETO OF DISCREPANCY <br> ( MAN )', 'id' => 'manModal', 'title' => 'Pareto of Discrepancy - MAN ', 'graph' => 'manGraph', 'table' => 'manTable'], ['heading' => 'PARETO OF DISCREPANCY <br> ( MATERIAL )', 'id' => 'materialModal', 'title' => 'Pareto of Discrepancy - MATERIAL ', 'graph' => 'materialGraph', 'table' => 'materialTable'], ['heading' => 'PARETO OF DISCREPANCY <br> ( METHOD / PROCESS )', 'id' => 'processModal', 'title' => 'Pareto of Discrepancy - METHOD / PROCESS ', 'graph' => 'processGraph', 'table' => 'processTable']]); $dt = Carbon::now('Asia/Manila'); $today = Info::where(DB::raw('DATE_FORMAT(created_at, "%m-%d-%Y")'), "=", $dt->format('m-d-Y'))->count(); $month = Info::where(DB::raw('MONTH(created_at)'), "=", $dt->month)->where(DB::raw('YEAR(created_at)'), "=", $dt->year)->count(); $week = Info::where(DB::raw('WEEK(created_at)'), "=", $dt->weekOfYear)->count(); $year = Info::where(DB::raw('YEAR(created_at)'), "=", $dt->year)->count(); $view->with('counts', [[$today, 'today-col', 'Issued today :', 'today', 'text-today'], [$week, 'week-col', 'Issued this week :', 'week', 'text-week'], [$month, 'month-col', 'Issued this month :', 'month', 'text-month'], [$year, 'year-col', 'Issued this year :', 'year', 'text-year']]); $yearOption = Info::select(DB::raw('YEAR(created_at) as year'))->groupBy('year')->get()->toArray(); $view->with('months', ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december']); $view->with('years', array_flatten($yearOption)); }
/** * Bind data to the view. * * @param Route $route * @param View $view */ public function compose(View $view) { $routeService = new Route(); $pilot = PilotRepository::getCurrentPilot(); $currentBooking = Booking::has('pirep', '<', 1)->where('pilot_id', '=', $pilot->id)->first(); $view->with('currentBooking', $currentBooking); $view->with('upcomingBookings', Booking::has('pirep', '<', 1)->limit(10)->skip(1)->where('pilot_id', '=', $pilot->id)->get()); $view->with('routePoints', $routeService->getAllPointsForRoute($currentBooking->route)); $view->with('depMetar', Cache::remember('Metar:' . $currentBooking->route->departureAirport->icao, 10, function () use($currentBooking) { return file_get_contents('http://weather.noaa.gov/pub/data/observations/metar/decoded/' . strtoupper($currentBooking->route->departureAirport->icao) . '.TXT'); })); $view->with('arrMetar', Cache::remember('Metar:' . $currentBooking->route->arrivalAirport->icao, 10, function () use($currentBooking) { return file_get_contents('http://weather.noaa.gov/pub/data/observations/metar/decoded/' . strtoupper($currentBooking->route->arrivalAirport->icao) . '.TXT'); })); }
/** * 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(); })); }
/** * @return string */ public function render() { foreach ($this->rendering as $callback) { $this->map($callback); } return (string) $this->presenter->with('attributes', $this->attributes)->with('children', $this->children)->with('data', $this->data); }
/** * 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); } }