Пример #1
0
 public function index(Advantage $advantage, Crew $crew)
 {
     $this->data['about'] = json_decode(file_get_contents(storage_path() . '/administrator_settings/about.json'));
     $this->data['advantages'] = $advantage->getAdvantages();
     $this->data['crew'] = $crew->getCrew();
     return view('pages.about', $this->data);
 }
Пример #2
0
 public function edit(Shop $shop)
 {
     $advantages = Advantage::get();
     $shop_advantages = $shop->advantages()->lists('advantage_id')->toArray();
     $themes = ['danger' => 'قرمز', 'violet' => 'بنفش', 'info' => 'آبی روشن', 'primary' => 'آبی تیره', 'success' => 'سبز'];
     return view('store.shop.edit', compact('shop', 'advantages', 'shop_advantages', 'themes'))->with(['title' => 'ویرایش فروشگاه']);
 }
Пример #3
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $advantages = [];
     $advantages[] = ['title' => 'ارسال سریع کالا', 'logo' => 'icon-checkout', 'description' => ''];
     $advantages[] = ['title' => 'تضمین اصالت', 'logo' => 'icon-shippment', 'description' => ''];
     $advantages[] = ['title' => 'گارانتی سلامت کالا', 'logo' => 'icon-calendar-1', 'description' => ''];
     $advantages[] = ['title' => 'ضمانت بازگشت', 'logo' => 'icon-refresh-1', 'description' => ''];
     $advantages[] = ['title' => 'بسته بندی شیک', 'logo' => 'icon-gift', 'description' => ''];
     $advantages[] = ['title' => 'پرداخت در محل', 'logo' => 'icon-wallet', 'description' => ''];
     foreach ($advantages as $advantage) {
         Advantage::create($advantage);
     }
 }
Пример #4
0
 public function profile(User $user)
 {
     $this->profile_visit($user);
     $role = $user->roles->first()->slug;
     $advantages = Advantage::get();
     //        $relatedUsers = $this->relatedUsersM($user);
     $relatedUsers = $this->showcase($user);
     $shop = $user->shop;
     if (count($shop)) {
         $advantage_shop = $user->shop->advantages()->lists('advantage_id')->toArray();
     } else {
         $advantage_shop = [];
     }
     $showcase_reserve = $user->showcases()->where('approved', 0)->count() - count($relatedUsers);
     $stickies = Auth::user()->stickies()->where('profile_id', $user->id)->get();
     return view('home.profile', compact('user', 'role', 'advantages', 'advantage_shop', 'shop', 'relatedUsers', 'showcase_reserve', 'stickies'))->with(['title' => $user->first_name]);
 }
Пример #5
0
 public function index()
 {
     $user = Auth::user();
     $info = $user->info()->with('user')->firstOrCreate(['user_id' => $user->id]);
     $provinces = Province::where('parent_id', null)->lists('name', 'id');
     if (!is_null($info->province_id)) {
         $cities = Province::where('parent_id', $info->province_id)->lists('name', 'id');
     } else {
         $cities = Province::where('parent_id', null)->firstOrFail()->getDescendants()->lists('name', 'id');
     }
     $location = $user->location()->firstOrCreate(['user_id' => $user->id]);
     $advantages = Advantage::get();
     $shop = $user->shop;
     if (count($shop)) {
         $advantage_shop = $user->shop->advantages()->lists('advantage_id')->toArray();
     } else {
         $advantage_shop = [];
     }
     return view('profile.index', compact('info', 'provinces', 'cities', 'location', 'user', 'advantages', 'advantage_shop', 'shop'))->with(['title' => $user->first_name]);
 }
Пример #6
0
 /**
  * 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');
 }