示例#1
0
 public function create()
 {
     $brands = Brand::get()->lists('name', 'id');
     $categories = Category::get()->lists('name', 'id');
     $units = Unit::get()->lists('name', 'id');
     return view('admin.products.create')->with('brands', $brands)->with('categories', $categories)->with('units', $units);
 }
 public function run()
 {
     DB::table('products')->delete();
     DB::table('products_brands')->delete();
     DB::table('products_categories')->delete();
     DB::table('products_units')->delete();
     Brand::create(['name' => 'Vevey']);
     Unit::create(['code' => 'PC', 'name' => 'Peça']);
     Category::create(['name' => 'Feminino']);
     Category::create(['name' => 'Masculino']);
 }