public function compare(Request $request) { if ($request->session()->has('compare')) { $compare = $request->session()->get('compare'); $skills = Skill::whereIn('id', $compare['cases'])->get(); return view('profile.compare', compact('skills'))->with(['title' => 'مقایسه مهارت ها']); } else { return redirect(route('profile.me')); } }
/** * Bootstrap the application services. * * @return void */ public function boot() { view()->composer('profile.partials.cover', function ($view) { $view->with(['user' => Auth::user()]); }); $this->composeEducation(new EducationRepository()); $this->composeBiography(); $this->composeMyArticles(); $this->composeSkill(); $this->composeLatestPosts(); $this->composeProfileProgress(); view()->composer('shop.partials.headerMenu', function ($view) { $shop = $view->getData()['shop']; $advantages = $shop->advantages()->lists('advantage_id')->toArray(); $advantages_list = Advantage::get(); $categories = $shop->products()->with('category')->groupBy('category_id')->get()->pluck('category.name', 'category.id'); $view->with(['advantages_list' => $advantages_list, 'advantages' => $advantages, 'categories' => $categories]); }); view()->composer('partials.navbar', function ($view) { if (Auth::check()) { if (session()->has('compare')) { $compare = session()->get('compare'); $skills = Skill::whereIn('id', $compare['cases'])->get(); $view->with(['compares' => $skills]); } $view->with(['authUser' => Auth::user()]); } }); /** * Created By Dara on 7/11/2015 * settlement side view compose */ view()->composer('partials.settleManagement', function ($view) { $view->with('amount', Auth::user()->credits()->sum('amount')); }); view()->composer('partials.settleManagement', 'App\\Http\\Controllers\\EventController'); }