예제 #1
0
 public function compose(View $view)
 {
     $view->with('uri', $this->request->path());
     $view->with('currentUser', $this->user);
     $view->with('roles_list', Role::lists('name', 'id'));
     $view->with('user_attributes_list', UserAttributes::lists('name', 'alias'));
     $view->with('restaurant_attributes_list', VendorAttributes::lists('name', 'alias'));
     $view->with('restaurant_locations_list', VendorLocation::wherehas('vendor.vendorType', function ($q) {
         $q->where('type', 'Restaurants');
     })->lists('slug', 'id'));
     $view->with('cities_list', Location::where('Type', 'City')->lists('name', 'id'));
     $view->with('locations_area_list', Location::where('Type', 'Area')->lists('name', 'id'));
     $view->with('cuisines', VendorAttributesSelectOptions::wherehas('attribute', function ($q) {
         $q->where('alias', 'cuisines');
     })->lists('option', 'id'));
     $view->with('_token', $this->encrypter->encrypt(csrf_token()));
     $view->with('media_url', Config::get('media.base_s3_url'));
     $view->with('curator_list', Curator::lists('name', 'id'));
     $view->with('tags_list', Collection::lists('name', 'id'));
     $view->with('flags_list', Flag::lists('name', 'id'));
     $view->with('restaurants_list', DB::table('vendors')->lists('name', 'id'));
     $experienceTypeArray = array('simple', 'complex');
     $view->with('experiences_list', DB::table('products')->whereIn('type', $experienceTypeArray)->lists('name', 'id'));
     $view->with('locations_list', Location::where('Type', 'Locality')->lists('name', 'id'));
     $view->with('price_type_list', PriceType::lists('type_name', 'id'));
     $variant_lists = DB::table('product_variant_options')->lists('variation_name', 'id');
     $view->with('variant_list', $variant_lists);
     $complex_experience_list = DB::table('products')->where('type', "complex")->lists('name', 'id');
     $view->with('complex_experience_list', $complex_experience_list);
     $curators_list = Curator::all()->lists('name', 'id');
     $curatorsList = [];
     foreach ($curators_list as $key => $value) {
         $curatorsList[] = ['id' => $key, 'text' => $value];
     }
     $flags_list = Flag::all()->lists('name', 'id');
     $flagsList = [];
     foreach ($flags_list as $key => $value) {
         $flagsList[] = ['id' => $key, 'text' => $value];
     }
     $restaurants_list = DB::table('vendors')->lists('name', 'id');
     $restaurantsList = [];
     foreach ($restaurants_list as $key => $value) {
         $restaurantsList[] = ['id' => $key, 'text' => $value];
     }
     $localities_list = Location::where('Type', 'Locality')->lists('name', 'id');
     $localitiesList = [];
     foreach ($localities_list as $key => $value) {
         $localitiesList[] = ['id' => $key, 'text' => $value];
     }
     //echo "test".die;
     JavaScript::put(['curatorsList' => $curatorsList, 'flagsList' => $flagsList, 'restaurantsList' => $restaurantsList, 'localitiesList' => $localitiesList]);
 }
예제 #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Flag::destroy($id);
     flash()->success('The Flag has been deleted successfully');
 }