/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $categoryData = [['category' => 'Appraiser', 'description' => 'A company that performs appraisals'], ['category' => 'Brokerage', 'description' => 'A licensed real estate brokerage'], ['category' => 'Contractor', 'description' => 'A company that performs work on specific houses'], ['category' => 'Employer', 'description' => 'A company that employs Leads, Clients, or Prospects'], ['category' => 'Home Inspection', 'description' => 'A company that performs home inspections'], ['category' => 'Insurance Company', 'description' => 'A company that provides insurance'], ['category' => 'Investor', 'description' => 'A company that invests in real property'], ['category' => 'Lender', 'description' => 'A company that loans money on real property'], ['category' => 'Other', 'description' => 'A company that does not fit any other category'], ['category' => 'Title Company	', 'description' => 'A company that provides title and escrow services'], ['category' => 'Vendor', 'description' => 'A company that provides services to the Principal']];
     foreach ($categoryData as $category) {
         $peopleCategory = CrudHelper::store(new \App\CompanyCategory(), $category);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $categoryData = [['category' => 'agent', 'description' => 'A person who is a licensed real estate agent'], ['category' => 'assistant', 'description' => 'A person who is an assistant to someone else'], ['category' => 'broker', 'description' => 'A person who is a licensed real estate broker'], ['category' => 'client', 'description' => 'A person for whom we are working on a transaction'], ['category' => 'contractor', 'description' => 'A person who performs work on houses or for the client'], ['category' => 'lead', 'description' => 'A person for whom we are not yet working on a transaction'], ['category' => 'lender', 'description' => 'A person who works for a mortgage company'], ['category' => 'other', 'description' => 'A person who does not fit into any of the other categories'], ['category' => 'principal', 'description' => 'The person who is the owner of the Jetlane software'], ['category' => 'prospect', 'description' => ''], ['category' => 'title agent', 'description' => 'A person who works for a title company'], ['category' => 'vendor', 'description' => 'A person who provides services to the Principal']];
     foreach ($categoryData as $category) {
         $peopleCategory = CrudHelper::store(new \App\PeopleCategory(), $category);
     }
 }
Esempio n. 3
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $roles = ['admin', 'customer'];
     foreach ($roles as $role) {
         $role = CrudHelper::store(new \App\Role(), ['role' => $role]);
     }
 }
Esempio n. 4
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $roles = ['admin', 'agent', 'lender', 'broker'];
     foreach ($roles as $role) {
         $roles = CrudHelper::store(new App\Role(), ['role' => $role]);
     }
 }
 /**
  * Obtain the user information from $provider
  *
  * @return Response
  */
 public function handleProviderCallback($provider)
 {
     $user = Socialite::driver($provider)->user();
     $data = ['name' => $user->name, 'email' => 'info+' . $user->nickname . '@sapioweb.com', 'password' => bcrypt('oauthinstagram'), 'token' => $user->token, 'profile_id' => $user->id, 'avatar' => $user->avatar, 'username' => $user->nickname];
     $authUser = CrudHelper::createOrUpdate(new \App\User(), 'profile_id', $user->id, $data)->first();
     \Auth::login($authUser, true);
     return redirect()->route('home');
     // $user->token;
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $i = 1;
     do {
         $image = ['image_url' => 'https://source.unsplash.com/featured/783x1008?nature=' . rand(1, 99), 'is_main' => rand(0, 1)];
         $image = CrudHelper::store(new App\Image(), $image);
         $i++;
     } while ($i <= 50);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $orderMake = [['amount' => rand(2, 14) * 5.9, 'order_number' => str_random(25)], ['amount' => rand(2, 14) * 5.9, 'order_number' => str_random(25)], ['amount' => rand(2, 14) * 5.9, 'order_number' => str_random(25)], ['amount' => rand(2, 14) * 5.9, 'order_number' => str_random(25)], ['amount' => rand(2, 14) * 5.9, 'order_number' => str_random(25)], ['amount' => rand(2, 14) * 5.9, 'order_number' => str_random(25)], ['amount' => rand(2, 14) * 5.9, 'order_number' => str_random(25)], ['amount' => rand(2, 14) * 5.9, 'order_number' => str_random(25)]];
     foreach ($orderMake as $order) {
         $order = CrudHelper::store(new App\Order(), $order);
         $order = CrudHelper::show(new App\Order(), 'id', $order['id'])->first();
         $order->products()->sync(['1', '2', '3']);
     }
 }
Esempio n. 8
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $users = [['name' => 'Andreas Admin', 'email' => '*****@*****.**', 'password' => bcrypt('2wsxzaq1'), 'role' => '1'], ['name' => 'Andreas Agent', 'email' => '*****@*****.**', 'password' => bcrypt('2wsxzaq1'), 'role' => '2'], ['name' => 'Andreas Lender', 'email' => '*****@*****.**', 'password' => bcrypt('2wsxzaq1'), 'role' => '3']];
     foreach ($users as $user) {
         $role = $user['role'];
         $user = CrudHelper::store(new App\User(), ['name' => $user['name'], 'email' => $user['email'], 'password' => $user['password']]);
         $user = CrudHelper::show(new App\User(), 'id', $user['id'])->first();
         $user->roles()->sync([$role]);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $topLevelCategories = ['men', 'women', 'new arrivals', 'accessories', 'sales'];
     $subCategories = ['mens tops', 'womens tops', 'womens sets', 'womens denim', 'mens denim', 'womens bottoms', 'womens sweaters', 'mens sweaters', 'womens jackets', 'mens jackets', 'womens dresses', 'womens jump suits', 'mens pants', 'mens shorts', 'new arivals mens', 'accessories mens', 'accessories women', 'new arivals women', 'sales women', 'sales mens'];
     foreach ($topLevelCategories as $topLevelCategory) {
         $category = CrudHelper::store(new App\Category(), ['category' => $topLevelCategory, 'is_sub_cat' => 0]);
     }
     foreach ($subCategories as $subCategory) {
         $category = CrudHelper::store(new App\Category(), ['category' => $subCategory, 'is_sub_cat' => 1]);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $productMake = ['15', '14', '13', '12', '11', '10', '9', '8', '7', '6', '5', '4', '3', '2', '1'];
     foreach ($productMake as $go) {
         $product = CrudHelper::store(new App\Product(), ['name' => 'Test Product ' . str_random(20), 'price' => rand(2, 14) * 5.9, 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed in leo quis neque cursus laoreet. Vestibulum sed placerat dolor. Donec sem purus, pulvinar quis felis eu, pharetra pharetra turpis. Praesent blandit, mauris nec euismod vulputate, nisl ex egestas purus, sed iaculis sem ipsum sed sem. Etiam ultrices lacus eu ante fringilla viverra. Cras ac pellentesque ipsum, et vulputate nulla. Duis consequat, tortor non pulvinar mollis, est orci eleifend ex, in rutrum risus augue nec enim. Donec dapibus mauris sit amet diam laoreet vehicula.']);
         $product = CrudHelper::show(new App\Product(), 'id', $product['id'])->first();
         $category = [rand(1, 10), rand(1, 10), rand(1, 10)];
         $images = [rand(1, 10), rand(1, 10), rand(1, 10), rand(1, 10), rand(1, 10)];
         $product->categories()->sync($category);
         $product->images()->sync($images);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     for ($i = 0; $i < 50; $i++) {
         $companyMake[$i] = $i;
     }
     foreach ($companyMake as $go) {
         $company = CrudHelper::store(new \App\CompanyContact(), ['name' => 'IamCompany ' . str_random('10'), 'dba' => 'Company ' . str_random('10'), 'organization' => 'Organization ' . str_random('10'), 'address_street' => '123 ' . str_random('7') . ' street', 'address_city' => str_random('10'), 'address_state' => str_random('10'), 'address_zip' => rand('11111', '99999'), 'country' => str_random('10'), 'phone' => rand('1111111111', '9999999999'), 'mobile_phone' => rand('1111111111', '9999999999'), 'other_phone' => rand('1111111111', '9999999999'), 'fax' => rand('1111111111', '9999999999'), 'email_1' => 'andreas+' . str_random('10') . '@sapioweb.com', 'email_2' => 'andreas+' . str_random('10') . '@sapioweb.com', 'email_3' => 'andreas+' . str_random('10') . '@sapioweb.com', 'website' => str_random('10') . '.com', 'created_by' => rand(1, 3)]);
         $canView = [rand(1, 2), rand(1, 3)];
         $company->canView()->sync($canView);
         $category = [rand(1, 11)];
         $company->category()->sync($category);
     }
 }
Esempio n. 12
0
 public function getCategoryIds($categories)
 {
     foreach ($categories as $categoryKey => $categoryValue) {
         if (is_null($categoryValue)) {
             unset($categories[$categoryKey]);
         }
     }
     foreach ($categories as $key => $value) {
         $category = CrudHelper::show(new \App\Category(), 'category', $value)->first();
         $categoryIds[] = $category->id;
     }
     return $categoryIds;
 }
Esempio n. 13
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     for ($i = 0; $i < 50; $i++) {
         $peopleMake[$i] = $i;
     }
     foreach ($peopleMake as $go) {
         $people = CrudHelper::store(new \App\PeopleContact(), ['first_name' => 'IamPerson ' . str_random('10'), 'middle_name' => 'MyMiddle ' . str_random('10'), 'last_name' => 'MyLast ' . str_random('10'), 'birthday_day' => date('d'), 'birthday_month' => date('m'), 'birthday_year' => date('Y'), 'gender' => 'm', 'address_street' => '123 ' . str_random('7') . ' street', 'address_city' => str_random('10'), 'address_state' => str_random('10'), 'address_zip' => rand('11111', '99999'), 'country' => str_random('10'), 'home_phone' => rand('1111111111', '9999999999'), 'business_phone' => rand('1111111111', '9999999999'), 'mobile_phone' => rand('1111111111', '9999999999'), 'other_phone' => rand('1111111111', '9999999999'), 'fax' => rand('1111111111', '9999999999'), 'email_1' => 'andreas+' . str_random('10') . '@sapioweb.com', 'email_2' => 'andreas+' . str_random('10') . '@sapioweb.com', 'email_3' => 'andreas+' . str_random('10') . '@sapioweb.com', 'avatar' => 'https://source.unsplash.com/category/buildings/?nature=' . rand('1', '90'), 'tax_id' => rand('1111111111', '9999999999'), 'created_by' => rand(1, 3)]);
         $canView = [rand(1, 2), rand(1, 3)];
         $people->canView()->sync($canView);
         $category = [rand(1, 12)];
         $people->category()->sync($category);
     }
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function updateAd(Request $request, $id)
 {
     $program = $this->showProgram($id);
     $adData = ['program_ad_id' => $program->slug, 'program_ad_title' => $program->titleStrong, 'destination_url' => url('/', $program->slug), 'program_ad_image_url' => url('/') . '/uploads/ads/ad_' . $program->slug . '.jpg', 'program_ad_subtitle' => $program->title, 'program_ad_description' => $program->bullet2, 'program_ad_category' => 'real estate', 'contextual_keywords' => 'closing costs;home assistance;buying home;real estate;'];
     $ad = CrudHelper::createOrUpdate(new \App\Ad(), 'program_ad_id', $id, $adData);
     $ad = $ad->first();
     if (is_null($ad)) {
         return redirect()->route('program.ad.manager', $program->slug)->with(['fail_message' => 'There was an isue with the ad, try again later...']);
     }
     $ad = $ad->toArray();
     $program->ad()->sync([$ad['id']]);
     return redirect()->route('program.ad.manager', $program->slug)->with(['success_message' => 'Ad has been updated...']);
 }
 public function downloadFeedCsv()
 {
     $file = '../storage/feeds/ad-feed-' . date('m-d-Y') . '.csv';
     $ads = CrudHelper::index(new \App\Ad())->get();
     $ads = $ads->toArray();
     $csvFile = fopen($file, 'w');
     $fields = ['ID', 'Item title', 'Destination URL', 'Image URL', 'Item subtitle', 'Item description', 'Item category', 'Contextual keywords'];
     fputcsv($csvFile, $fields);
     foreach ($ads as $ad) {
         $inloadToCsv = ['ID' => $ad['program_ad_id'], 'Item title' => $ad['program_ad_title'], 'Destination URL' => $ad['destination_url'], 'Image URL' => $ad['program_ad_image_url'], 'Item subtitle' => $ad['program_ad_subtitle'], 'Item description' => $ad['program_ad_description'], 'Item category' => $ad['program_ad_category'], 'Contextual keywords' => $ad['contextual_keywords']];
         fputcsv($csvFile, $inloadToCsv);
     }
     fclose($csvFile);
     return response()->download($file);
 }
Esempio n. 16
0
 public function show($id)
 {
     $product = CrudHelper::show(new \App\Product(), 'id', $id, ['categories', 'images'])->first()->toArray();
     $categories = $product['categories'];
     $images = $product['images'];
     foreach ($images as $isMain) {
         if ($isMain['is_main'] === 1) {
             $mainImage[] = $isMain;
         }
     }
     $mainImage = $mainImage[0];
     foreach ($categories as $category) {
         $productCategories[] = $category['category'];
     }
     $productCategories = implode(', ', $productCategories);
     return view('shop.shopSingle')->with(['product' => $product, 'productCategories' => $productCategories, 'images' => $images, 'mainImage' => $mainImage]);
 }
Esempio n. 17
0
 public function showSingleOrder($orderNumber)
 {
     $order = CrudHelper::show(new \App\Order(), 'order_number', $orderNumber, ['products'])->first();
     dd($order);
 }
Esempio n. 18
0
 public function createContact($model, $data)
 {
     if (isset($data['avatar'])) {
         $avatarUpload = $this->avatarUpload($data['avatar']);
         $data['avatar'] = $avatarUpload;
     }
     unset($data['_token']);
     unset($data['notes']);
     $data['created_by'] = \Auth::user()->id;
     $contact = CrudHelper::store($model, $data);
     if (isset($data['can_view'])) {
         $canView = $data['can_view'];
         $this->canView($contact, $canView);
     }
     return $contact;
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $program = CrudHelper::show(new \App\Program(), 'id', $id);
     foreach ($request->all() as $key => $value) {
         $updateData[$key] = $value;
     }
     unset($updateData['_method']);
     unset($updateData['_token']);
     $updateData['slug'] = CrudHelper::slugify($updateData['titleStrong'] . ' ' . $updateData['title']);
     $program->update($updateData);
     $program = $this->programLinter($program);
     $program = $program->first();
     return redirect()->route('program.edit', $program['slug'])->with('success_message', 'Property Updated');
 }
Esempio n. 20
0
 public function showHome()
 {
     $products = CrudHelper::index(new \App\Product(), ['images'])->take(8)->orderBy('id', 'DESC')->get();
     return view('pages.index')->with(['products' => $products]);
 }
 public function showProgram($id)
 {
     $program = CrudHelper::show(new \App\Program(), 'slug', $id);
     $program = $this->programLinter($program);
     return $program;
 }