/** * Run the database seeds. * * @return void */ public function run() { # Lexus - GS450h $manufacturer_id = \App\Manufacturer::where('name', '=', 'Lexus')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'GS450h', 'style' => 'Premium', 'manufacturer_id' => $manufacturer_id, 'size_id' => 5, 'user_id' => 1, 'year' => 2016, 'price' => 68125, 'picture' => 'https://media.ed.edmunds-media.com/lexus/gs-450h/2016/oem/2016_lexus_gs-450h_sedan_base_fq_oem_2_500.jpg', 'purchase_link' => 'http://www.lexus.com/build-your-lexus/#!/series/GS/']); # Jeep - Grand Cherokee $manufacturer_id = \App\Manufacturer::where('name', '=', 'Jeep')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'Grand Cherokee', 'style' => 'Altitude', 'manufacturer_id' => $manufacturer_id, 'size_id' => 5, 'user_id' => 2, 'year' => 2016, 'price' => 34499, 'picture' => 'https://media.ed.edmunds-media.com/jeep/grand-cherokee/2016/fe/2016_jeep_grand-cherokee_f34_fe_1106151_500.jpg', 'purchase_link' => 'http://www.jeep.com/model-compare/detailed-chart/?modelYearCode=CUJ201503&variation=1']); # Honda - Accord Hybrid $manufacturer_id = \App\Manufacturer::where('name', '=', 'Honda')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'Accord Hybrid', 'style' => 'Touring', 'manufacturer_id' => $manufacturer_id, 'size_id' => 5, 'user_id' => 1, 'year' => 2016, 'price' => 29600, 'picture' => 'https://media.ed.edmunds-media.com/honda/accord-hybrid/2015/oem/2015_honda_accord-hybrid_sedan_touring_rq_oem_1_500.jpg', 'purchase_link' => 'http://automobiles.honda.com/accord-hybrid/price.aspx']); # Lexus - IS $manufacturer_id = \App\Manufacturer::where('name', '=', 'Lexus')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'IS 350', 'style' => 'F Sport', 'manufacturer_id' => $manufacturer_id, 'size_id' => 1, 'user_id' => 2, 'year' => 2016, 'price' => 27499, 'picture' => 'https://media.ed.edmunds-media.com/lexus/is-350/2016/oem/2016_lexus_is-350_sedan_base_rq_oem_1_500.jpg', 'purchase_link' => 'http://www.lexus.com/build-your-lexus/#!/zip/02108/series/IS/trim']); # Toyota - Prius v $manufacturer_id = \App\Manufacturer::where('name', '=', 'Toyota')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'Prius v', 'style' => 'Base', 'manufacturer_id' => $manufacturer_id, 'size_id' => 2, 'user_id' => 2, 'year' => 2016, 'price' => 22900, 'picture' => 'https://media.ed.edmunds-media.com/toyota/prius-v/2016/oem/2016_toyota_prius-v_wagon_five_rq_oem_1_500.jpg', 'purchase_link' => 'http://www.toyota.com/priusv/']); # Toyota - Mirai $manufacturer_id = \App\Manufacturer::where('name', '=', 'Toyota')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'Mirai', 'style' => 'Base', 'manufacturer_id' => $manufacturer_id, 'size_id' => 1, 'user_id' => 1, 'year' => 2016, 'price' => 18900, 'picture' => 'https://media.ed.edmunds-media.com/toyota/mirai/2016/ns/2016_toyota_mirai_prf_ns_111814_500.jpg', 'purchase_link' => 'https://ssl.toyota.com/mirai/fcv.html']); # Honda - Fit $manufacturer_id = \App\Manufacturer::where('name', '=', 'Honda')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'Fit', 'style' => 'Base', 'manufacturer_id' => $manufacturer_id, 'size_id' => 1, 'user_id' => 4, 'year' => 2016, 'price' => 15600, 'picture' => 'https://media.ed.edmunds-media.com/honda/fit/2016/oem/2016_honda_fit_4dr-hatchback_ex-l-wnavigation_s_oem_1_500.jpg', 'purchase_link' => 'http://automobiles.honda.com/fit/price.aspx']); # Hyundai - Tucson EV $manufacturer_id = \App\Manufacturer::where('name', '=', 'Hyundai')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'Tucson EV', 'style' => 'Base', 'manufacturer_id' => $manufacturer_id, 'size_id' => 5, 'user_id' => 3, 'year' => 2016, 'price' => 40999, 'picture' => 'https://media.ed.edmunds-media.com/hyundai/tucson/2016/oem/2016_hyundai_tucson_4dr-suv_limited_s_oem_1_500.jpg', 'purchase_link' => 'https://www.hyundaiusa.com/tucsonfuelcell/index.aspx']); # Mercedes Benz - B-Class $manufacturer_id = \App\Manufacturer::where('name', '=', 'Mercedes Benz')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'B-Class', 'style' => 'Base', 'manufacturer_id' => $manufacturer_id, 'size_id' => 1, 'user_id' => 3, 'year' => 2016, 'price' => 41450, 'picture' => 'https://media.ed.edmunds-media.com/mercedes-benz/b-class-electric-drive/2016/oem/2016_mercedes-benz_b-class-electric-drive_4dr-hatchback_b250e_s_oem_2_500.jpg', 'purchase_link' => 'https://www.mbusa.com/mercedes/vehicles/build/class-B/model-B250E#tab=tab-exterior']); }
/** * Bootstrap the application services. * * @return void */ public function boot() { view()->composer(['products.partials.form', 'partials.nav', 'partials.sidebar'], function ($view) { $view->with('categories', Category::lists('name', 'id')); $view->with('manufacturers', Manufacturer::lists('name', 'id')); }); }
/** * Save products from list * * @param $products */ public function saveFromList($products) { $this->cleanTable('products'); foreach ($products as $product) { Product::create(['number' => $product['id'], 'name' => $product['name'], 'manufacturer_id' => Manufacturer::whereName($product['manufacturer'])->first()->id, 'model' => $product['model'], 'category_id' => Category::whereName($product['category'])->first()->id, 'price' => $product['price'], 'processor' => $product['processor'], 'memory' => $product['memory'], 'hdd' => $product['hdd'], 'graphics' => $product['graphics'], 'screen' => $product['screen'], 'optical' => $product['optical']]); } }
/** * Run the database seeds. * * @return void */ public function run() { Product::create(['name' => 'IMac', 'description' => utf8_encode('Cuando te sientas delante de un iMac todo desaparece a tu alrededor, y eso es porque literalmente te sumerges en su pantalla. Para conseguir algo tan espectacular hemos ido más lejos que nunca. Hemos tenido en cuenta hasta el mínimo detalle. Y hemos llevado el iMac a una nueva dimensión.'), 'price' => 130000, 'active' => 1, 'manufacturer_id' => Manufacturer::whereName('Apple')->first()->id, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s'), 'rating' => rand(1, 5), 'stock' => rand(5, 99)]); Product::create(['name' => 'IPod', 'description' => utf8_encode('El iPod touch es la mejor forma de llevar todas tus canciones en el bolsillo. Con el iTunes Store tienes a tu disposición el catálogo de música más grande del mundo, así que por temazos no será. Gracias a iCloud, lo que compras en el iTunes Store aparece en todos tus dispositivos de forma automática. Y si realmente quieres vivir la música de mil y una formas, busca Apple Music en la app Música.'), 'price' => 22900, 'active' => 1, 'manufacturer_id' => Manufacturer::whereName('Apple')->first()->id, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s'), 'rating' => rand(1, 5), 'stock' => rand(5, 99)]); Product::create(['name' => 'Altavoces', 'description' => utf8_encode('El sonido de tu música, películas o juegos brillará con nuestros altavoces. Emociónate con la calidad del sonido sin que importe el lugar o la situación.'), 'price' => 17999, 'active' => 1, 'manufacturer_id' => Manufacturer::whereName('Creative')->first()->id, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s'), 'rating' => rand(1, 5), 'stock' => rand(5, 99)]); Product::create(['name' => utf8_encode('Cascos inalámbricos'), 'description' => utf8_encode('Disfruta de la pericia del maestro del sonido con los cascos con micrófono estrella Creative Aurvana Platinum. Con potentes conductores Neodymium de 50 mm, NFC, Bluetooth® 3.0, tecnología Tri-Mode ANC y Creative ShareMe™, son la combinación perfecta entre sonido, diseño y comodidad. Además, admiten sonido de calidad de alta definición con aptX® y AAC, y de una mejor comunicación por voz con ClearSpeech™ Engine.'), 'price' => 19999, 'active' => 1, 'manufacturer_id' => Manufacturer::whereName('Creative')->first()->id, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s'), 'rating' => rand(1, 5), 'stock' => rand(5, 99)]); Product::create(['name' => 'HP Z Display Z27i IPS', 'description' => utf8_encode('Completa tu estación de trabajo con este monitor profesional HP Z Display Z27i IPS. Visualiza todos los detalles en una pantalla de 68,6 cm (27") en diagonal y una resolución máxima de 2560 x 1440 y 3,7 millones de píxeles para lograr una mayor productividad. '), 'price' => 71269, 'active' => 1, 'manufacturer_id' => Manufacturer::whereName('Hewlett Packard')->first()->id, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s'), 'rating' => rand(1, 5), 'stock' => rand(5, 99)]); }
/** * Display a listing of all Aircrafts. * * @return JSON */ public function index() { if (\Request::ajax()) { return Manufacturer::with('aircraft')->get(); } else { return view('template.aircraftoverview'); } }
/** * Display a listing of the resource. * * @return Response */ public function addOrder() { // $dealers = \App\Dealer::orderBy("name", "asc")->lists("name", "id")->toArray(); $manufacturers = \App\Manufacturer::orderBy("name", "asc")->lists("name", "id")->toArray(); $dealers = array('' => 'Select dealers') + $dealers; $manufacturers = array('' => 'Select manufacturers') + $manufacturers; return view("users.orders.add", ['manufacturers' => $manufacturers, 'dealers' => $dealers]); }
public function test($file) { \Excel::load($file, function ($reader) { $results = $reader->get()->toArray(); //echo "<pre>"; //print_r($results); foreach ($results as $row) { $man = new Manufacturer(); $man->name = $row['name']; $man->uploadfilename = $row['uploadfilename']; $man->info = $row['info']; $man->user_id = Auth::id(); $man->created_at = $row['created_at']; $man->updated_at = $row['updated_at']; $man->save(); } echo "success"; }); }
public function index() { $manufacturers = Manufacturer::all(); return Response::json($manufacturers, $this->code); }
public function run() { Manufacturer::create(['name' => 'Apple', 'img' => 'http://www.clipartbest.com/cliparts/KTj/e86/KTje864Gc.png', 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')]); Manufacturer::create(['name' => 'Creative', 'img' => 'http://es.creative.com/content/images/Creative-Logo.png', 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')]); Manufacturer::create(['name' => 'Hewlett Packard', 'img' => 'http://www.mouseoc.co.il/wp-content/uploads/2015/07/hp-logo.png', 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')]); }
/** * Create manufacturer * * @param $manufacturer */ public function save($manufacturer) { Manufacturer::create(['name' => $manufacturer]); }
public function editProduct($id) { $product = \App\Product::findOrFail($id); $manufacturers = \App\Manufacturer::lists('name', 'id'); return view('admin/products/edit', ['product' => $product, 'manufacturers' => $manufacturers]); }