Ejemplo n.º 1
0
 public function store_warehouse(Request $request)
 {
     $warehouse = new Warehouse();
     $warehouse->name = $request->name;
     $warehouse->location = $request->location;
     $warehouse->save();
     return redirect('/manage/warehouses');
 }
Ejemplo n.º 2
0
 public function postRegistrar(Request $request)
 {
     $validator = Validator::make($request->all(), ['name' => 'required|max:70']);
     if ($validator->fails()) {
         return redirect('almacenes')->withInput()->withErrors($validator);
     }
     $wareHouse = new Warehouse();
     $wareHouse->name = $request->name;
     $wareHouse->type = $request->type;
     $wareHouse->state = $request->state;
     $wareHouse->city_id = $request->city;
     $wareHouse->comments = $request->comments;
     $wareHouse->save();
     return redirect('almacenes');
 }