Example #1
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 private function index1()
 {
     $price = PriceModel::all();
     $data = [];
     foreach ($price as $item) {
         $data[$item->id] = $item->id_stok;
     }
     return $data;
 }
Example #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $price = PriceModel::find($id);
     $price->delete();
     // notif
     Session::flash('message', 'data di hapus');
     // redirect
     return Redirect::to('price');
 }