diff --git a/.gitignore b/.gitignore index f0d10af..2b3c556 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /public/build /public/hot /public/storage +/public/uploads /storage/*.key /vendor .env diff --git a/database/seeders/DummySeeder.php b/database/seeders/DummySeeder.php index 384b113..4eed431 100644 --- a/database/seeders/DummySeeder.php +++ b/database/seeders/DummySeeder.php @@ -79,26 +79,30 @@ class DummySeeder extends Seeder public function voucher() { - $batchId = Str::ulid(); + $vouchers = GeneralService::script_parser(file_get_contents(public_path('example.md'))); - $location = Location::first(); DB::beginTransaction(); - foreach ($vouchers as $voucher) { - Voucher::create([ - 'location_id' => $location->id, - 'username' => $voucher['username'], - 'password' => $voucher['password'], - 'discount' => 10, - 'display_price' => 100000, - 'quota' => $voucher['quota'], - 'profile' => $voucher['profile'], - 'comment' => $voucher['comment'], - 'expired' => 30, - 'expired_unit' => 'Hari', - 'batch_id' => $batchId, - ]); + foreach ([1, 2] as $loop) { + $batchId = Str::ulid(); + $location = Location::get()[$loop]; + + foreach ($vouchers as $voucher) { + Voucher::create([ + 'location_id' => $location->id, + 'username' => $voucher['username'], + 'password' => $voucher['password'], + 'discount' => $loop == 1 ? 10 : 0, + 'display_price' => $loop == 1 ? 100000 : 99000, + 'quota' => $voucher['quota'], + 'profile' => $voucher['profile'], + 'comment' => $voucher['comment'], + 'expired' => 30, + 'expired_unit' => 'Hari', + 'batch_id' => $batchId, + ]); + } } DB::commit(); } diff --git a/public/uploads/5SmLKPkZsSsosDLC4lOSuDwuOChLU73drcOrKoNd.png b/public/uploads/5SmLKPkZsSsosDLC4lOSuDwuOChLU73drcOrKoNd.png deleted file mode 100644 index a8309f6..0000000 Binary files a/public/uploads/5SmLKPkZsSsosDLC4lOSuDwuOChLU73drcOrKoNd.png and /dev/null differ diff --git a/public/uploads/HJ7nplQVetjWYeMH02TeI4CqZCaRcxGueiylrRFH.png b/public/uploads/HJ7nplQVetjWYeMH02TeI4CqZCaRcxGueiylrRFH.png deleted file mode 100644 index 3635370..0000000 Binary files a/public/uploads/HJ7nplQVetjWYeMH02TeI4CqZCaRcxGueiylrRFH.png and /dev/null differ diff --git a/public/uploads/NJl0MsrOekJjqc2eTqTntDarwqGDmfWTRPvatfqj.png b/public/uploads/NJl0MsrOekJjqc2eTqTntDarwqGDmfWTRPvatfqj.png deleted file mode 100644 index b6f830c..0000000 Binary files a/public/uploads/NJl0MsrOekJjqc2eTqTntDarwqGDmfWTRPvatfqj.png and /dev/null differ diff --git a/public/uploads/O28lqSXxDFqVCmtJ3xYgZgMpCTblUNFbhnGFUaky.png b/public/uploads/O28lqSXxDFqVCmtJ3xYgZgMpCTblUNFbhnGFUaky.png deleted file mode 100644 index 893a840..0000000 Binary files a/public/uploads/O28lqSXxDFqVCmtJ3xYgZgMpCTblUNFbhnGFUaky.png and /dev/null differ diff --git a/public/uploads/Ro0dn8ddZ3YD83BPGRmpwDBi8MDgseSk3Vrz9rXA.png b/public/uploads/Ro0dn8ddZ3YD83BPGRmpwDBi8MDgseSk3Vrz9rXA.png deleted file mode 100644 index b6f830c..0000000 Binary files a/public/uploads/Ro0dn8ddZ3YD83BPGRmpwDBi8MDgseSk3Vrz9rXA.png and /dev/null differ diff --git a/public/uploads/TOvqXsbQBjbJTIM6he1ylcPLK5VM38BXWBLSSaLE.png b/public/uploads/TOvqXsbQBjbJTIM6he1ylcPLK5VM38BXWBLSSaLE.png deleted file mode 100644 index b6f830c..0000000 Binary files a/public/uploads/TOvqXsbQBjbJTIM6he1ylcPLK5VM38BXWBLSSaLE.png and /dev/null differ diff --git a/public/uploads/Tb00StkRPTn9EOhn1osSFQAZNKJpbRjCFYH22Qul.png b/public/uploads/Tb00StkRPTn9EOhn1osSFQAZNKJpbRjCFYH22Qul.png deleted file mode 100644 index 485ae9e..0000000 Binary files a/public/uploads/Tb00StkRPTn9EOhn1osSFQAZNKJpbRjCFYH22Qul.png and /dev/null differ diff --git a/public/uploads/XWztTeRNi8ATbkoQ3MGuZ2k0J1sjA28roZvu8nei.png b/public/uploads/XWztTeRNi8ATbkoQ3MGuZ2k0J1sjA28roZvu8nei.png deleted file mode 100644 index b6f830c..0000000 Binary files a/public/uploads/XWztTeRNi8ATbkoQ3MGuZ2k0J1sjA28roZvu8nei.png and /dev/null differ diff --git a/public/uploads/xBp4LHXEpYZMFVMefQWomjZtXzZF6eSI3PitI9xH.png b/public/uploads/xBp4LHXEpYZMFVMefQWomjZtXzZF6eSI3PitI9xH.png deleted file mode 100644 index 485ae9e..0000000 Binary files a/public/uploads/xBp4LHXEpYZMFVMefQWomjZtXzZF6eSI3PitI9xH.png and /dev/null differ diff --git a/resources/js/Pages/Home/Deposit/Detail.jsx b/resources/js/Pages/Home/Deposit/Detail.jsx index 427a450..80bf1e5 100644 --- a/resources/js/Pages/Home/Deposit/Detail.jsx +++ b/resources/js/Pages/Home/Deposit/Detail.jsx @@ -122,7 +122,13 @@ const FormUpload = () => { if (processing) { return } - post(route('customer.deposit.update', deposit)) + post(route('customer.deposit.update', deposit), { + onSuccess: () => + setTimeout( + () => router.get(route(route().current(), deposit)), + 3000 + ), + }) } return (