예제 #1
0
 public function store()
 {
     $atur = array('quantity' => 'required|numeric');
     $validasi = Validator::make(Input::all(), $atur);
     if ($validasi->fails()) {
         return Redirect::to('stok/create')->withErrors($validasi)->withInput();
     } else {
         $stok = new StockModel();
         $stok->id_barang = Input::get('id_barang');
         $stok->id_inventory = Input::get('id_inventory');
         $stok->quantity = Input::get('quantity');
         $stok->save();
         Session::flash('message', 'data di simpan');
         return Redirect::to('stok');
     }
 }