private function createBrands() { Brand::create(['id' => '2', 'name' => 'Colinagro']); Brand::create(['id' => '3', 'name' => 'Monsanto']); Brand::create(['id' => '4', 'name' => 'Yara']); Brand::create(['id' => '5', 'name' => 'Monomeros']); Brand::create(['id' => '6', 'name' => 'Campofert']); Brand::create(['id' => '7', 'name' => 'Nufarm']); Brand::create(['id' => '8', 'name' => 'Aygust']); Brand::create(['id' => '9', 'name' => 'AGSE']); Brand::create(['id' => '10', 'name' => 'Mejisulfatos']); }
function editProduct($id) { $brands = Brand::all(); $farms = FarmCategory::with('farms')->get(); $categories = Category::all(); $user = auth()->user(); if ($user->role_id == 1) { $productEdit = Product::find($id); return view('back.productAdminEdit', compact('productEdit', 'offerEdit', 'categories', 'farms', 'brands')); } else { $productEdit = ProductProvider::find($id); $offer = $productEdit->offer()->first(); return view('back.productProviderEdit', compact('productEdit', 'offer', 'categories', 'farms', 'brands')); } }
/** * Run the database seeds. * * @return void */ public function run() { Brand::create(['name' => 'Marca prueba', 'logo' => 'logo.png', 'description' => 'description']); }