/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $batches = array(['batch_name' => 'BE6', 'department_id' => '1'], ['batch_name' => 'BE5', 'department_id' => '1'], ['batch_name' => 'BT5', 'department_id' => '2'], ['batch_name' => 'BCS1', 'department_id' => '3']);
     foreach ($batches as $batch) {
         Batch::create($batch);
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $input = Request::all();
     Batch::create($input);
     DB::connection()->enableQueryLog();
     \DB::enableQueryLog();
     dd($input);
     //
 }
Esempio n. 3
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $circles = Circle::all();
     foreach ($circles as $circle) {
         $count = rand(0, 4);
         if ($count == 0) {
             continue;
         }
         foreach (range(1, $count) as $number) {
             Batch::create(['maxscore' => rand(10, 40), 'circle_id' => $circle->id, 'seqno' => $number]);
         }
     }
 }
Esempio n. 4
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     //Handle validation
     $this->validate($request, ['description' => 'required', 'parcel_id' => 'required', 'destination' => 'required'], ['parcel_id.required' => 'Please select the parcels you want to add to batch.']);
     // Uncomment and modify if you need to validate any input.
     $data = $request->all();
     $data['status_id'] = 1;
     $data['town_id'] = 1;
     $data['user_id'] = auth()->user()->id;
     $data['code'] = (new Parcels())->getNextCode();
     $batch = Batch::create($data);
     $batch->parcels()->sync($request->get('parcel_id'));
     event(new ActivityLog(auth()->user()->username . ' has created the batch ' . $batch->description . ' with the code ' . $batch->code . ' successfully.'));
     alert()->success('Batch created successfully.', 'success');
     return redirect('batch');
 }
Esempio n. 5
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateSaldoRequest $request)
 {
     $data = $request->all();
     if ($data['pilihan'] == 'baru') {
         $fill['serial'] = $data['serial'];
         $fill['barang_id'] = $data['barang_id'];
         $fill['kadaluwarsa'] = $data['kadaluwarsa'];
         $fill['volume'] = $data['volume'];
         $fill['berat'] = $data['berat'];
         //			$fill['gambar'] = $data['gambar'];
         $batch = Batch::create($fill);
         $fill2['batch_id'] = $batch->id;
     } else {
         $fill2['batch_id'] = $data['batch_id'];
     }
     $fill2['gudang_id'] = $data['gudang_id'];
     $fill2['tanggal'] = $data['tanggal'];
     $fill2['nomor_bukti'] = $data['nomor_bukti'];
     $fill2['kuantitas'] = $data['kuantitas'];
     $fill2['hpp_satuan'] = $data['hpp_satuan'];
     Saldo::create($fill2);
     return redirect('saldo');
 }
Esempio n. 6
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateBatchRequest $request)
 {
     //dd($request->all());
     Batch::create($request->all());
     return redirect('batch');
 }
Esempio n. 7
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['circle_id' => 'required|exists:circle,id', 'maxscore' => 'required|numeric|min:1|max:40']);
     $batch = Batch::create(['circle_id' => $request->circle_id, 'maxscore' => $request->maxscore, 'seqno' => $request->seqno]);
     return redirect('batch/' . $batch->id . '/edit');
 }