From bff3570401b8bfef7c5a8777fd561f1a656308a6 Mon Sep 17 00:00:00 2001 From: faiqahzaman <91926774+faiqahzaman@users.noreply.github.com> Date: Thu, 20 Jan 2022 15:54:37 +0800 Subject: [PATCH 01/21] get list lelong details --- .../AuthMobile/LelongController.php | 17 ------ .../AuthMobile/LelongMobileController.php | 60 +++++++++++++++++++ .../AuthMobile/NewPasswordController.php | 2 +- database/seeders/RolesSeeder.php | 8 +++ routes/api.php | 9 +-- 5 files changed, 74 insertions(+), 22 deletions(-) delete mode 100644 app/Http/Controllers/AuthMobile/LelongController.php create mode 100644 app/Http/Controllers/AuthMobile/LelongMobileController.php diff --git a/app/Http/Controllers/AuthMobile/LelongController.php b/app/Http/Controllers/AuthMobile/LelongController.php deleted file mode 100644 index 2b057812..00000000 --- a/app/Http/Controllers/AuthMobile/LelongController.php +++ /dev/null @@ -1,17 +0,0 @@ -where('t_lelong','=',$t_lelong) - ->first(); - - } -} diff --git a/app/Http/Controllers/AuthMobile/LelongMobileController.php b/app/Http/Controllers/AuthMobile/LelongMobileController.php new file mode 100644 index 00000000..8b85d7b2 --- /dev/null +++ b/app/Http/Controllers/AuthMobile/LelongMobileController.php @@ -0,0 +1,60 @@ +toDateString(); + + $lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get(); + + $arrayID = []; + foreach($lelong as $data) + { + array_push($arrayID,$data->id); + } + $lelongbid = LelongBid::whereIn('lelong_id',$arrayID) + ->join('lelongbidmarhun','lelongbid.id','=','lelongbidmarhun.lelongbid_id') + ->get(); + + $surat = LelongBid::whereIn('lelong_id',$arrayID)->get(); + + if(sizeof($lelongbid)!=0) + { + return response()->json([ + 'success' => true, + 'lelong' => $lelong, + 'surat' => $surat, + 'item' => $lelongbid + ]); + } + else + { + return response()->json([ + 'success' => false, + 'message' => 'No Data', + ], 401); + } + + } + + public function getlelongdetails(Request $request){ + + $currentdate = Carbon::now(); + $currentdate = $currentdate->toDateString(); + + $lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get(); + + + } +} diff --git a/app/Http/Controllers/AuthMobile/NewPasswordController.php b/app/Http/Controllers/AuthMobile/NewPasswordController.php index 070d2976..8e486e4f 100644 --- a/app/Http/Controllers/AuthMobile/NewPasswordController.php +++ b/app/Http/Controllers/AuthMobile/NewPasswordController.php @@ -1,6 +1,6 @@ 'Admin', 'username' => 'Admin', 'email' => 'admin@example.com', + 'user_type' => 1 ]); $user->assignRole($role1); @@ -167,6 +168,7 @@ class RolesSeeder extends Seeder 'name' => 'Khazanah', 'username' => 'Khazanah', 'email' => 'khazanah@example.com', + 'user_type' => 1 ]); $user->assignRole($role2); @@ -174,6 +176,7 @@ class RolesSeeder extends Seeder 'name' => 'Teller', 'username' => 'Teller', 'email' => 'teller@example.com', + 'user_type' => 1 ]); $user->assignRole($role3); @@ -181,6 +184,7 @@ class RolesSeeder extends Seeder 'name' => 'Pengurus Cawangan', 'username' => 'PC', 'email' => 'penguruscawangan@example.com', + 'user_type' => 1 ]); $user->assignRole($role4); @@ -188,6 +192,7 @@ class RolesSeeder extends Seeder 'name' => 'Juru Lelong', 'username' => 'Juru Lelong', 'email' => 'jurulelong@example.com', + 'user_type' => 1 ]); $user->assignRole($role5); @@ -195,6 +200,7 @@ class RolesSeeder extends Seeder 'name' => 'Operasi', 'username' => 'Operasi', 'email' => 'operasi@example.com', + 'user_type' => 1 ]); $user->assignRole($role6); @@ -202,6 +208,7 @@ class RolesSeeder extends Seeder 'name' => 'Account', 'username' => 'Account', 'email' => 'account@example.com', + 'user_type' => 1 ]); $user->assignRole($role7); @@ -209,6 +216,7 @@ class RolesSeeder extends Seeder 'name' => 'Pembida', 'username' => 'Pembida', 'email' => 'pembida@example.com', + 'user_type' => 2 ]); $user->assignRole($role8); } diff --git a/routes/api.php b/routes/api.php index 9ea4ff19..c8537bd8 100644 --- a/routes/api.php +++ b/routes/api.php @@ -4,8 +4,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; use App\Http\Controllers\AuthMobile\AuthController; use App\Http\Controllers\AuthMobile\UserController; -use App\Http\Controllers\CartController; -use App\Http\Controllers\AuthMobile\LelongController; +use App\Http\Controllers\AuthMobile\LelongMobileController; /* |-------------------------------------------------------------------------- @@ -35,10 +34,12 @@ Route::group(['middleware' => ['auth:sanctum']], function () { Route::post('/updateItem', [CartController::class, 'updateItem']); Route::get('/deleteItem/{id}', [CartController::class, 'deleteCart']); Route::post('/forgotPassword', [NewPasswordController::class, 'forgotPassword']); - Route::post('/resetPassword', [NewPasswordController::class, 'reset']); + Route::post('/reset', [NewPasswordController::class, 'reset']); Route::get('/user/profile', [UserController::class, 'getProfileUser']); Route::put('/userUpdate/profile', [UserController::class, 'updateProfileUser']); - Route::put('/lelong', [LelongController::class, 'listLelongDetails']); + Route::get('/details/lelong', [LelongMobileController::class, 'listLelongDetails']); + Route::get('/lelongDetails/today', [LelongMobileController::class, 'getlelongdetails']); + }); From 073cf456cfdaf202b08cc2cdc2d4a9639bcb4dcf Mon Sep 17 00:00:00 2001 From: faiqahzaman <91926774+faiqahzaman@users.noreply.github.com> Date: Thu, 20 Jan 2022 16:50:21 +0800 Subject: [PATCH 02/21] trial --- .../AuthMobile/LelongMobileController.php | 67 ++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/AuthMobile/LelongMobileController.php b/app/Http/Controllers/AuthMobile/LelongMobileController.php index 8b85d7b2..1b2e6169 100644 --- a/app/Http/Controllers/AuthMobile/LelongMobileController.php +++ b/app/Http/Controllers/AuthMobile/LelongMobileController.php @@ -55,6 +55,71 @@ class LelongMobileController extends Controller $lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get(); - + $arrayLelong = []; + $lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get(); + + // $lelongbid = LelongBid::where('t_lelong', '=', $currentdate) + // ->select('lelong_id', + // 'id as lelongbid_id', + // 'caw_id', + // 'kodcaw', + // 'norujukan', + // 't_lelong as tarikh_lelong', + // 'hargaasas', + // 'hargajual', + // 't_jual', + // 'nopembeli', + // 'jbg', + // 'kadarupah', + // 'upahsimpan', + // 'ansuran', + // 'pinjaman', + // 'bakiupah', + // 'cajlain', + // 'cajlelong', + // 'baki', + // 'gst_hj', + // 'gst_cl', + // 'percent', + // 'status_jual', + // 'status_payment') + // ->get(); + + $lelongbid = LelongBid::whereIn('lelong_id',$arrayLelong) + ->select('lelong_id', + 'id as lelongbid_id', + 'caw_id', + 'kodcaw', + 'norujukan', + 't_lelong as tarikh_lelong', + 'hargaasas', + 'hargajual', + 't_jual', + 'nopembeli', + 'jbg', + 'kadarupah', + 'upahsimpan', + 'ansuran', + 'pinjaman', + 'bakiupah', + 'cajlain', + 'cajlelong', + 'baki', + 'gst_hj', + 'gst_cl', + 'percent', + 'status_jual', + 'status_payment') + ->union($lelong) + ->get(); + + $lelongbidmarhun = LelongBidMarhun::join('lelongbid', 'lelongbidmarhun.lelongbid_id', '=', 'lelongbid.id') + ->get(); + + + array_push($arrayLelong,['lelong' => $lelong,'lelong_bid' => $lelongbid, 'lelong_bid_marhun' => $lelongbidmarhun]); + + return response()->json($arrayLelong); + } } From 62899b4d55011d4b9d52177f4ce7983a7cdd6468 Mon Sep 17 00:00:00 2001 From: faiqahzaman <91926774+faiqahzaman@users.noreply.github.com> Date: Sun, 23 Jan 2022 16:02:04 +0800 Subject: [PATCH 03/21] get lelong details & get list karat --- .../AuthMobile/LelongMobileController.php | 91 +++++++++++-------- ...01_23_042652_create_lelongbidder_table.php | 53 +++++++++++ routes/api.php | 5 +- routes/web.php | 6 ++ 4 files changed, 116 insertions(+), 39 deletions(-) create mode 100644 database/migrations/2022_01_23_042652_create_lelongbidder_table.php diff --git a/app/Http/Controllers/AuthMobile/LelongMobileController.php b/app/Http/Controllers/AuthMobile/LelongMobileController.php index 1b2e6169..2ecee188 100644 --- a/app/Http/Controllers/AuthMobile/LelongMobileController.php +++ b/app/Http/Controllers/AuthMobile/LelongMobileController.php @@ -7,6 +7,7 @@ use Illuminate\Http\Request; use App\Models\Lelong; use App\Models\LelongBid; use App\Models\LelongBidMarhun; +use App\Models\lelkarat; use Carbon\Carbon; class LelongMobileController extends Controller @@ -53,11 +54,8 @@ class LelongMobileController extends Controller $currentdate = Carbon::now(); $currentdate = $currentdate->toDateString(); - $lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get(); - - $arrayLelong = []; - $lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get(); - + // $arrayLelong = []; + $lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get()->toArray(); // $lelongbid = LelongBid::where('t_lelong', '=', $currentdate) // ->select('lelong_id', // 'id as lelongbid_id', @@ -85,41 +83,60 @@ class LelongMobileController extends Controller // 'status_payment') // ->get(); - $lelongbid = LelongBid::whereIn('lelong_id',$arrayLelong) - ->select('lelong_id', - 'id as lelongbid_id', - 'caw_id', - 'kodcaw', - 'norujukan', - 't_lelong as tarikh_lelong', - 'hargaasas', - 'hargajual', - 't_jual', - 'nopembeli', - 'jbg', - 'kadarupah', - 'upahsimpan', - 'ansuran', - 'pinjaman', - 'bakiupah', - 'cajlain', - 'cajlelong', - 'baki', - 'gst_hj', - 'gst_cl', - 'percent', - 'status_jual', - 'status_payment') - ->union($lelong) - ->get(); + foreach($lelong as $index1=>$lel) + { + $lelongbid = LelongBid::whereIn('lelong_id',$lelong) + ->select('lelong_id', + 'id as lelongbid_id', + 'caw_id', + 'kodcaw', + 'norujukan', + 't_lelong as tarikh_lelong', + 'hargaasas', + 'hargajual', + 't_jual', + 'nopembeli', + 'jbg', + 'kadarupah', + 'upahsimpan', + 'ansuran', + 'pinjaman', + 'bakiupah', + 'cajlain', + 'cajlelong', + 'baki', + 'gst_hj', + 'gst_cl', + 'percent', + 'status_jual', + 'status_payment') + // ->union($lelong) + ->get()->toArray(); - $lelongbidmarhun = LelongBidMarhun::join('lelongbid', 'lelongbidmarhun.lelongbid_id', '=', 'lelongbid.id') - ->get(); + $lelongbidmarhun = LelongBidMarhun::join('lelongbid', 'lelongbidmarhun.lelongbid_id', '=', 'lelongbid.id') + ->get()->toArray(); - - array_push($arrayLelong,['lelong' => $lelong,'lelong_bid' => $lelongbid, 'lelong_bid_marhun' => $lelongbidmarhun]); + $lelong[$index1]['lelongbid'] = $lelongbid; + $lelong[$index1]['lelongbid']['lelongbidmarhun'] = $lelongbidmarhun; + // array_push($lelong[$index1],'lelongzz','lasdsa'); + + + + + // array_push($lelong[$index1],['lelong_bid' => $lelongbid[0], 'lelong_bid_marhun' => $lelongbidmarhun]); + } + + return response()->json($lelong); - return response()->json($arrayLelong); + } + + public function getListKarat(Request $request){ + + $getKarat = lelkarat::all(); + + // $user = User::all(); + + return response()->json($getKarat); } } diff --git a/database/migrations/2022_01_23_042652_create_lelongbidder_table.php b/database/migrations/2022_01_23_042652_create_lelongbidder_table.php new file mode 100644 index 00000000..99e77450 --- /dev/null +++ b/database/migrations/2022_01_23_042652_create_lelongbidder_table.php @@ -0,0 +1,53 @@ +bigIncrements('id'); + $table->unsignedBigInteger('user_id')->unsigned(); + $table->integer('lelongbid_id'); + $table->string('nama_bidder'); + $table->decimal('hargabida'); + $table->integer('nosirilel'); + $table->datetime('t_lelong'); + $table->integer('nopembeli'); + $table->decimal('nilaimarhun'); + $table->decimal('cajlelong'); + $table->integer('status_bidder'); + $table->integer('status_bidder_win'); + $table->integer('status_payment'); + $table->datetime('masa_bidaan'); + $table->integer('status_jual')->nullable(); + $table->string('tempstatus_bidder'); + $table->datetime('deleted_at')->nullable(); + $table->integer('deleted_by')->nullable(); + $table->timestamps(); + + + $table->foreign('user_id') + ->references('id')->on('users') + ->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('lelongbidder'); + } +} diff --git a/routes/api.php b/routes/api.php index c8537bd8..f106f8ed 100644 --- a/routes/api.php +++ b/routes/api.php @@ -37,9 +37,10 @@ Route::group(['middleware' => ['auth:sanctum']], function () { Route::post('/reset', [NewPasswordController::class, 'reset']); Route::get('/user/profile', [UserController::class, 'getProfileUser']); Route::put('/userUpdate/profile', [UserController::class, 'updateProfileUser']); - Route::get('/details/lelong', [LelongMobileController::class, 'listLelongDetails']); + // Route::get('/details/lelong', [LelongMobileController::class, 'listLelongDetails']); Route::get('/lelongDetails/today', [LelongMobileController::class, 'getlelongdetails']); - + Route::get('/karat', [LelongMobileController::class, 'getListKarat']); + }); diff --git a/routes/web.php b/routes/web.php index 3d56d08e..2dc0c6b7 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,6 +1,7 @@ name('login'); +Route::get('/test', function () { + $response = Http::get('http://localhost:8000/api/lelongDetails/today')->json(); + dd($response); +})->name('test'); + Auth::routes(); Route::get('/home','HomeController@index')->name('home'); From e26d8d94d73299402e2067bd73f81b9bede43685 Mon Sep 17 00:00:00 2001 From: faiqahzaman <91926774+faiqahzaman@users.noreply.github.com> Date: Mon, 24 Jan 2022 10:01:47 +0800 Subject: [PATCH 04/21] update get lelong details --- .../AuthMobile/LelongMobileController.php | 76 ++++++++++--------- .../Controllers/AuthMobile/UserController.php | 3 +- routes/api.php | 1 - 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/app/Http/Controllers/AuthMobile/LelongMobileController.php b/app/Http/Controllers/AuthMobile/LelongMobileController.php index 2ecee188..993e1a61 100644 --- a/app/Http/Controllers/AuthMobile/LelongMobileController.php +++ b/app/Http/Controllers/AuthMobile/LelongMobileController.php @@ -12,42 +12,6 @@ use Carbon\Carbon; class LelongMobileController extends Controller { - public function listLelongDetails(Request $request){ - - $currentdate = Carbon::now(); - $currentdate = $currentdate->toDateString(); - - $lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get(); - - $arrayID = []; - foreach($lelong as $data) - { - array_push($arrayID,$data->id); - } - $lelongbid = LelongBid::whereIn('lelong_id',$arrayID) - ->join('lelongbidmarhun','lelongbid.id','=','lelongbidmarhun.lelongbid_id') - ->get(); - - $surat = LelongBid::whereIn('lelong_id',$arrayID)->get(); - - if(sizeof($lelongbid)!=0) - { - return response()->json([ - 'success' => true, - 'lelong' => $lelong, - 'surat' => $surat, - 'item' => $lelongbid - ]); - } - else - { - return response()->json([ - 'success' => false, - 'message' => 'No Data', - ], 401); - } - - } public function getlelongdetails(Request $request){ @@ -134,9 +98,47 @@ class LelongMobileController extends Controller $getKarat = lelkarat::all(); - // $user = User::all(); + // $lelongBidder = lelongBidder::all(); return response()->json($getKarat); } + + public function bidderSelectBidItem(Request $request){ + + $feepayment = payment::where('fee' == 1)->first(); + + if($feepayment != null){ + + $selectBid = LelongBid::join('lelong', 'lelongbid.lelong_id', '=', 'lelong.id') + ->where('norujukan', $request->norujukan) + ->select('id', + 't_lelong', + 'nilaimarhun', + 'cajlelong') + ->get(); + + $currentdate = Carbon::now()->toDateTimeString(); + + $lelongBidder = new LelongBidder(); + $lelongBidder->nama_bidder = $fields['nama_bidder']; + $lelongBidder->hargabida = $fields['hargabida']; + $lelongBidder->nosirilel = $fields['nosirilel']; + $lelongBidder->nopembeli = $fields['nopembeli']; + $lelongBidder->t_lelong = $selectBid; + $lelongBidder->lelongbid_id = $selectBid; + $lelongBidder->nilaimarhun = $selectBid; + $lelongBidder->cajlelong = $selectBid; + $lelongBidder->status_bidder = $fields['status_bidder']; + $lelongBidder->status_bidder_win = $fields['status_bidder_win']; + $lelongBidder->status_payment = $fields['status_payment']; + $lelongBidder->masa_bidaan = $currentdate; + $lelongBidder->lelongBidder_type = 2; //type 2 = pembida + $lelongBidder->save(); + + } + else if($feepayment == null){ + return response()->json("unsuccess", 201); + } + } } diff --git a/app/Http/Controllers/AuthMobile/UserController.php b/app/Http/Controllers/AuthMobile/UserController.php index 11fd6ed2..a81b2f58 100644 --- a/app/Http/Controllers/AuthMobile/UserController.php +++ b/app/Http/Controllers/AuthMobile/UserController.php @@ -34,8 +34,7 @@ class UserController extends Controller return response($validator->errors(), 201); } - $currentdate = Carbon::now(); - $currentdate = $currentdate->toDateString(); + $currentdate = Carbon::now()->toDateTimeString(); $user_update = User::where('nokp','=',$request->nokp) ->update([ diff --git a/routes/api.php b/routes/api.php index f106f8ed..c0e4015a 100644 --- a/routes/api.php +++ b/routes/api.php @@ -37,7 +37,6 @@ Route::group(['middleware' => ['auth:sanctum']], function () { Route::post('/reset', [NewPasswordController::class, 'reset']); Route::get('/user/profile', [UserController::class, 'getProfileUser']); Route::put('/userUpdate/profile', [UserController::class, 'updateProfileUser']); - // Route::get('/details/lelong', [LelongMobileController::class, 'listLelongDetails']); Route::get('/lelongDetails/today', [LelongMobileController::class, 'getlelongdetails']); Route::get('/karat', [LelongMobileController::class, 'getListKarat']); From 088c112d47391ff6fa07e3c5f1e1141c5c16d566 Mon Sep 17 00:00:00 2001 From: faiqahzaman <91926774+faiqahzaman@users.noreply.github.com> Date: Mon, 24 Jan 2022 10:02:11 +0800 Subject: [PATCH 05/21] update select bid item --- .../2022_01_23_042652_create_lelongbidder_table.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/database/migrations/2022_01_23_042652_create_lelongbidder_table.php b/database/migrations/2022_01_23_042652_create_lelongbidder_table.php index 99e77450..578eda1b 100644 --- a/database/migrations/2022_01_23_042652_create_lelongbidder_table.php +++ b/database/migrations/2022_01_23_042652_create_lelongbidder_table.php @@ -19,19 +19,12 @@ class CreateLelongbidderTable extends Migration $table->integer('lelongbid_id'); $table->string('nama_bidder'); $table->decimal('hargabida'); - $table->integer('nosirilel'); - $table->datetime('t_lelong'); - $table->integer('nopembeli'); + $table->string('notelbimbit'); $table->decimal('nilaimarhun'); $table->decimal('cajlelong'); - $table->integer('status_bidder'); - $table->integer('status_bidder_win'); - $table->integer('status_payment'); + $table->integer('status_bidder')->nullable(); + $table->integer('status_payment')->nullable(); $table->datetime('masa_bidaan'); - $table->integer('status_jual')->nullable(); - $table->string('tempstatus_bidder'); - $table->datetime('deleted_at')->nullable(); - $table->integer('deleted_by')->nullable(); $table->timestamps(); From 310dd3598ed07dc9bde21d66f980127ed64ee3fa Mon Sep 17 00:00:00 2001 From: faiqahzaman <91926774+faiqahzaman@users.noreply.github.com> Date: Mon, 24 Jan 2022 12:25:13 +0800 Subject: [PATCH 06/21] update get lelong details --- .../AuthMobile/LelongMobileController.php | 55 +++++-------------- 1 file changed, 15 insertions(+), 40 deletions(-) diff --git a/app/Http/Controllers/AuthMobile/LelongMobileController.php b/app/Http/Controllers/AuthMobile/LelongMobileController.php index 993e1a61..115509fa 100644 --- a/app/Http/Controllers/AuthMobile/LelongMobileController.php +++ b/app/Http/Controllers/AuthMobile/LelongMobileController.php @@ -20,32 +20,6 @@ class LelongMobileController extends Controller // $arrayLelong = []; $lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get()->toArray(); - // $lelongbid = LelongBid::where('t_lelong', '=', $currentdate) - // ->select('lelong_id', - // 'id as lelongbid_id', - // 'caw_id', - // 'kodcaw', - // 'norujukan', - // 't_lelong as tarikh_lelong', - // 'hargaasas', - // 'hargajual', - // 't_jual', - // 'nopembeli', - // 'jbg', - // 'kadarupah', - // 'upahsimpan', - // 'ansuran', - // 'pinjaman', - // 'bakiupah', - // 'cajlain', - // 'cajlelong', - // 'baki', - // 'gst_hj', - // 'gst_cl', - // 'percent', - // 'status_jual', - // 'status_payment') - // ->get(); foreach($lelong as $index1=>$lel) { @@ -74,20 +48,20 @@ class LelongMobileController extends Controller 'percent', 'status_jual', 'status_payment') - // ->union($lelong) - ->get()->toArray(); - - $lelongbidmarhun = LelongBidMarhun::join('lelongbid', 'lelongbidmarhun.lelongbid_id', '=', 'lelongbid.id') ->get()->toArray(); $lelong[$index1]['lelongbid'] = $lelongbid; - $lelong[$index1]['lelongbid']['lelongbidmarhun'] = $lelongbidmarhun; - // array_push($lelong[$index1],'lelongzz','lasdsa'); - - - - - // array_push($lelong[$index1],['lelong_bid' => $lelongbid[0], 'lelong_bid_marhun' => $lelongbidmarhun]); + + foreach($lelongbid as $index2=>$lelbidmarhun){ + + // $id = lelongbid::first(); + + $lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $lelbidmarhun['lelongbid_id']) + ->get()->toArray(); + + $lelong[$index1]['lelongbid'][$index2]['lelongbidmarhun'] = $lelongbidmarhun; + } + } return response()->json($lelong); @@ -110,10 +84,11 @@ class LelongMobileController extends Controller if($feepayment != null){ - $selectBid = LelongBid::join('lelong', 'lelongbid.lelong_id', '=', 'lelong.id') + $selectBid = Lelong::join('lelongbid', 'lelong.id', '=', 'lelongbid.lelong_id') + ->join('cart', 'lelongbid.id', '=', 'cart.lelongbid_id') ->where('norujukan', $request->norujukan) - ->select('id', - 't_lelong', + ->select('lelongbid.id as lelongbid_id', + 'lelongbid.t_lelong', 'nilaimarhun', 'cajlelong') ->get(); From 5f4b357efd0cae7749484f35a62eb780a2ced237 Mon Sep 17 00:00:00 2001 From: Azfar Arsyad <45238748+Arpax17@users.noreply.github.com> Date: Mon, 24 Jan 2022 12:26:29 +0800 Subject: [PATCH 07/21] commit --- app/Http/Controllers/CartController.php | 42 ++++++------------------- routes/api.php | 1 + 2 files changed, 11 insertions(+), 32 deletions(-) diff --git a/app/Http/Controllers/CartController.php b/app/Http/Controllers/CartController.php index 6844171c..ff503093 100644 --- a/app/Http/Controllers/CartController.php +++ b/app/Http/Controllers/CartController.php @@ -36,31 +36,19 @@ class CartController extends Controller public function getCart($userid) { - $carts = Cart::where('user_id','=', $userid)->get(); + $carts = Cart::where('user_id','=', $userid)->get()->toArray(); - foreach($carts as $cart) + foreach($carts as $index => $cart) { - $arraycart = []; - $lelongbid = LelongBid::where('id',$cart->lelongbid_id)->first(); - $marhun = LelongBidMarhun::where('lelongbid_id','=',$lelongbid->id)->get(); - $lelongbid->marhun = $marhun; - $cart->lelongbid = $lelongbid; + $lelongbid = LelongBid::where('id',$cart['lelongbid_id'])->first()->toArray(); + $marhun = LelongBidMarhun::where('lelongbid_id','=',$lelongbid['id'])->get()->toArray(); + + $carts[$index]['datalelongbid'] = $lelongbid; + $carts[$index]['datalelongbid']['lelongbidmarhun'] = $marhun; } - if(sizeof($carts)!=0) - { - return response()->json([ - 'success' => true, - 'carts' => $carts - ]); - } - else - { - return response()->json([ - 'success' => false, - 'message' => 'No Data', - ], 401); - } + + return response()->json($carts); } public function addToCart(Request $request) @@ -72,19 +60,9 @@ class CartController extends Controller if($item->save()) { - $carts = Cart::where('user_id','=', $request->user_id)->get(); - - foreach($carts as $cart) - { - $arraycart = []; - $lelongbid = LelongBid::where('id',$cart->lelongbid_id)->first(); - $marhun = LelongBidMarhun::where('lelongbid_id','=',$lelongbid->id)->get(); - $lelongbid->marhun = $marhun; - $cart->lelongbid = $lelongbid; - } return response()->json([ 'success' => true, - 'carts' => $carts + 'carts' => $item ]); } else diff --git a/routes/api.php b/routes/api.php index c0e4015a..2684f03b 100644 --- a/routes/api.php +++ b/routes/api.php @@ -5,6 +5,7 @@ use Illuminate\Support\Facades\Route; use App\Http\Controllers\AuthMobile\AuthController; use App\Http\Controllers\AuthMobile\UserController; use App\Http\Controllers\AuthMobile\LelongMobileController; +use App\Http\Controllers\CartController; /* |-------------------------------------------------------------------------- From 9339c1fdf4d267a4489bd5d426c5035df70da5fe Mon Sep 17 00:00:00 2001 From: faiqahzaman <91926774+faiqahzaman@users.noreply.github.com> Date: Mon, 24 Jan 2022 13:31:04 +0800 Subject: [PATCH 08/21] update get lelong details --- .../AuthMobile/LelongMobileController.php | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/app/Http/Controllers/AuthMobile/LelongMobileController.php b/app/Http/Controllers/AuthMobile/LelongMobileController.php index 115509fa..7e4da094 100644 --- a/app/Http/Controllers/AuthMobile/LelongMobileController.php +++ b/app/Http/Controllers/AuthMobile/LelongMobileController.php @@ -24,30 +24,6 @@ class LelongMobileController extends Controller foreach($lelong as $index1=>$lel) { $lelongbid = LelongBid::whereIn('lelong_id',$lelong) - ->select('lelong_id', - 'id as lelongbid_id', - 'caw_id', - 'kodcaw', - 'norujukan', - 't_lelong as tarikh_lelong', - 'hargaasas', - 'hargajual', - 't_jual', - 'nopembeli', - 'jbg', - 'kadarupah', - 'upahsimpan', - 'ansuran', - 'pinjaman', - 'bakiupah', - 'cajlain', - 'cajlelong', - 'baki', - 'gst_hj', - 'gst_cl', - 'percent', - 'status_jual', - 'status_payment') ->get()->toArray(); $lelong[$index1]['lelongbid'] = $lelongbid; @@ -56,7 +32,7 @@ class LelongMobileController extends Controller // $id = lelongbid::first(); - $lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $lelbidmarhun['lelongbid_id']) + $lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $lelbidmarhun['id']) ->get()->toArray(); $lelong[$index1]['lelongbid'][$index2]['lelongbidmarhun'] = $lelongbidmarhun; From bd0ba075a5727095d8dc49b3413e0495bee16aa0 Mon Sep 17 00:00:00 2001 From: faiqahzaman <91926774+faiqahzaman@users.noreply.github.com> Date: Tue, 25 Jan 2022 14:05:14 +0800 Subject: [PATCH 09/21] update payment resit table --- .../AuthMobile/LelongMobileController.php | 23 ++++-- .../AuthMobile/PaymentController.php | 13 ++++ ...01_23_042652_create_lelongbidder_table.php | 6 +- ...2022_01_25_010223_create_payment_table.php | 77 +++++++++++++++++++ routes/api.php | 1 + 5 files changed, 111 insertions(+), 9 deletions(-) create mode 100644 app/Http/Controllers/AuthMobile/PaymentController.php create mode 100644 database/migrations/2022_01_25_010223_create_payment_table.php diff --git a/app/Http/Controllers/AuthMobile/LelongMobileController.php b/app/Http/Controllers/AuthMobile/LelongMobileController.php index 7e4da094..3f9aefff 100644 --- a/app/Http/Controllers/AuthMobile/LelongMobileController.php +++ b/app/Http/Controllers/AuthMobile/LelongMobileController.php @@ -6,8 +6,11 @@ use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Models\Lelong; use App\Models\LelongBid; +use App\Models\LelongBidder; use App\Models\LelongBidMarhun; use App\Models\lelkarat; +use App\Models\User; +use App\Models\Payment; use Carbon\Carbon; class LelongMobileController extends Controller @@ -28,7 +31,7 @@ class LelongMobileController extends Controller $lelong[$index1]['lelongbid'] = $lelongbid; - foreach($lelongbid as $index2=>$lelbidmarhun){ + foreach($lelongbid as $index2=>$lelbidmarhun){ // $id = lelongbid::first(); @@ -56,6 +59,13 @@ class LelongMobileController extends Controller public function bidderSelectBidItem(Request $request){ + $post_data = $request->all(); + if (isset($post_data['user_token'])) { + [$id, $user_token] = explode('|', $post_data['user_token'], 2); + $token_data = DB::table('personal_access_tokens')->where('token', hash('sha256', $partner_token))->first(); + $user_id = $user_id->tokenable_id; // !!!THIS ID WE CAN USE TO GET DATA OF YOUR USER!!! + } + $feepayment = payment::where('fee' == 1)->first(); if($feepayment != null){ @@ -65,26 +75,23 @@ class LelongMobileController extends Controller ->where('norujukan', $request->norujukan) ->select('lelongbid.id as lelongbid_id', 'lelongbid.t_lelong', - 'nilaimarhun', - 'cajlelong') + 'lelongbid.nilaimarhun', + 'lelongbid.cajlelong', + 'cart.hargabida') ->get(); $currentdate = Carbon::now()->toDateTimeString(); $lelongBidder = new LelongBidder(); $lelongBidder->nama_bidder = $fields['nama_bidder']; - $lelongBidder->hargabida = $fields['hargabida']; - $lelongBidder->nosirilel = $fields['nosirilel']; - $lelongBidder->nopembeli = $fields['nopembeli']; + $lelongBidder->hargabida = $selectBid; $lelongBidder->t_lelong = $selectBid; $lelongBidder->lelongbid_id = $selectBid; $lelongBidder->nilaimarhun = $selectBid; $lelongBidder->cajlelong = $selectBid; $lelongBidder->status_bidder = $fields['status_bidder']; - $lelongBidder->status_bidder_win = $fields['status_bidder_win']; $lelongBidder->status_payment = $fields['status_payment']; $lelongBidder->masa_bidaan = $currentdate; - $lelongBidder->lelongBidder_type = 2; //type 2 = pembida $lelongBidder->save(); } diff --git a/app/Http/Controllers/AuthMobile/PaymentController.php b/app/Http/Controllers/AuthMobile/PaymentController.php new file mode 100644 index 00000000..1aebcf99 --- /dev/null +++ b/app/Http/Controllers/AuthMobile/PaymentController.php @@ -0,0 +1,13 @@ +bigIncrements('id'); $table->unsignedBigInteger('user_id')->unsigned(); - $table->integer('lelongbid_id'); + $table->unsignedBigInteger('lelongbid_id')->unsigned(); $table->string('nama_bidder'); $table->decimal('hargabida'); $table->string('notelbimbit'); @@ -31,6 +31,10 @@ class CreateLelongbidderTable extends Migration $table->foreign('user_id') ->references('id')->on('users') ->onDelete('cascade'); + + $table->foreign('lelongbid_id') + ->references('id')->on('lelongbid') + ->onDelete('cascade'); }); } diff --git a/database/migrations/2022_01_25_010223_create_payment_table.php b/database/migrations/2022_01_25_010223_create_payment_table.php new file mode 100644 index 00000000..4f15579f --- /dev/null +++ b/database/migrations/2022_01_25_010223_create_payment_table.php @@ -0,0 +1,77 @@ +bigIncrements('id'); + $table->unsignedBigInteger('user_id')->unsigned(); + $table->unsignedBigInteger('lelongbidder_id')->unsigned()->nullable(); + $table->unsignedBigInteger('lelongbid_id')->unsigned(); + $table->string('kodcaw')->nullable(); + $table->decimal('total_payment')->nullable(); + $table->string('back_acc_pembeli')->nullable(); + $table->string('bank_acc_no_pembeli')->nullable(); + $table->string('nama_bank_acc_caw')->nullable(); + $table->string('bank_no_acc_caw')->nullable(); + $table->integer('status_payment_opt')->nullable(); + $table->integer('resit_id'); + $table->integer('status'); //1 = fee RM10 , 2 = paybidifwin + $table->string('remark'); + $table->timestamps(); + + $table->foreign('user_id') + ->references('id')->on('users') + ->onDelete('cascade'); + + $table->foreign('lelongbid_id') + ->references('id')->on('lelongbid') + ->onDelete('cascade'); + + $table->foreign('lelongbidder_id') + ->references('id')->on('lelongbidder') + ->onDelete('cascade'); + }); + + Schema::create('resit', function (Blueprint $table) { + $table->bigIncrements('id'); + $table->unsignedBigInteger('user_id')->unsigned(); + $table->unsignedBigInteger('lelongbid_id')->unsigned()->nullable(); + $table->string('reference_no')->nullable(); + $table->integer('billplz_id'); + $table->string('total_payment'); + $table->string('resit_type'); + $table->timestamps(); + + $table->foreign('user_id') + ->references('id')->on('users') + ->onDelete('cascade'); + + $table->foreign('lelongbid_id') + ->references('id')->on('lelongbid') + ->onDelete('cascade'); + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('payment'); + Schema::dropIfExists('resit'); + } +} diff --git a/routes/api.php b/routes/api.php index 2684f03b..451f406f 100644 --- a/routes/api.php +++ b/routes/api.php @@ -40,6 +40,7 @@ Route::group(['middleware' => ['auth:sanctum']], function () { Route::put('/userUpdate/profile', [UserController::class, 'updateProfileUser']); Route::get('/lelongDetails/today', [LelongMobileController::class, 'getlelongdetails']); Route::get('/karat', [LelongMobileController::class, 'getListKarat']); + Route::post('/bidder/biditem', [LelongMobileController::class, 'bidderSelectBidItem']); }); From fa35c56a1c6bd95a7b453b2620414ad2d11cfd79 Mon Sep 17 00:00:00 2001 From: Azfar Arsyad <45238748+Arpax17@users.noreply.github.com> Date: Tue, 25 Jan 2022 14:06:05 +0800 Subject: [PATCH 10/21] commit --- app/Http/Controllers/ApiController.php | 205 +++ .../AuthMobile/LelongMobileController.php | 6 +- app/Http/Controllers/CartController.php | 2 + composer.json | 2 + composer.lock | 1151 ++++++++++++++++- 5 files changed, 1363 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/ApiController.php b/app/Http/Controllers/ApiController.php index d7f5ee59..25f768d1 100644 --- a/app/Http/Controllers/ApiController.php +++ b/app/Http/Controllers/ApiController.php @@ -26,7 +26,13 @@ use App\Models\LelongBid; use App\Models\LelongBidMarhun; use App\Models\LelKarat; use App\Models\LelKarat_temp; + +use Session; use Carbon\Carbon; +use Money\Money; +use Billplz\Client; +use Http\Client\Common\HttpMethodsClient; +use Http\Adapter\Guzzle7\Client as GuzzleHttpClient; class ApiController extends Controller { @@ -41,6 +47,19 @@ class ApiController extends Controller * * @return \Illuminate\Contracts\Support\Renderable */ + public function __construct(){ + parent::__construct(); + if(config('app.env') != 'production'){ + $this->api_key = 'abecfd0c-98d8-4635-abc2-2fcba8c60c11'; + $this->XSignature_Key = 'S-GWr7z03XjAhqPsFfu_H5nQ'; + $this->collection_id = 'bwdtejv0'; + }else{ + $this->api_key = 'f3e82fe1-a422-4660-97f0-65cc59ff6c47'; + $this->XSignature_Key = 'S-alZUbzmD2_TF3vmrRqgehQ'; + } + + + } public function biditem() { @@ -101,6 +120,192 @@ class ApiController extends Controller ], 401); } } + + public function PembayaranEngine(Request $request) + { + + $arraycollection_id = array(); + + $http = new HttpMethodsClient( + new GuzzleHttpClient(), + new GuzzleMessageFactory() + ); + + $billplz = new Client($http, $this->api_key); + if(config('app.env') != 'production'){ + $billplz->useSandbox(); + } + + $billplz->useVersion('v4'); + + $bill = $billplz->bill(); + + $current = Carbon::now(); + $current = new Carbon(); + + $day = $current->day; + $month = $current->month; + $year = $current->format('y'); + + $total_bayaran = 10; + + + $response = $bill->create( + $collection_id, + $request->email, + $request->notel, + $request->name, + Money::MYR($total_bayaran), + route('pay.callback'), + 'Bayaran Ansuran', + ['redirect_url' => route('pay.paymentStatus')] + ); + + $billcode = $response->toArray(); + + foreach($array_payment as $index1=>$arraypay) + { + $previous_siri = Http::get(config('api.url') . '/api/online/transaction')->json(); + if($previous_siri){ + $nosiri = $previous_siri['nosiri'] + 1; + }else{ + $nosiri = 1; + } + + $reference_no = 'LPKB' . $day . $month . $year . sprintf("%08d", $nosiri); + + $new_transaction = Http::post(config('api.url') . '/api/online/transaction',[ + 'nokp'=> Auth::user()->icno, + 'reference_no'=> $reference_no, + 'nosiri'=> $nosiri, + 'billplz_id' => $billcode['id'], + 'norujukan' => $arraypay['norujukan'], + 'kodcaw' => $arraypay['kodcaw'], + 'total_payment'=> $arraypay['bayaran'], + 'customer_name' => Auth::user()->name, + ])->json(); + + } + + + return redirect($billcode['url'] . '?auto_submit=true'); + + // return view('pembayaran.result.berjaya',compact('arraybayaran')); + } + public function callback(Request $request){ + $http = new HttpMethodsClient( + new GuzzleHttpClient(), + new GuzzleMessageFactory() + ); + + $billplz = new Client($http, $this->api_key); + if(config('app.env') != 'production'){ + $billplz->useSandbox(); + } + $billplz->useVersion('v4'); + + $bill = $billplz->bill(); + + $data = $bill->webhook($request->toArray()); + + if($data['billplz']['paid'] == 'true'){ + Http::put(config('api.url') . '/api/online/transaction',[ + 'billplz_id' => $data['billplz']['id'], + 'status' => 'PAID', + 'paid_at' => $data['billplz']['paid_at'] + ]); + + $transactionOnline = Http::get(config('api.url') . '/api/transaction/online/express',[ + 'billplz_id' => $data['billplz']['id'] + ])->json(); + + return redirect()->route('pay.success',[ + 'transactionOnline' => $transactionOnline + ]); + + }else{ + Http::put(config('api.url') . '/api/online/transaction',[ + 'billplz_id' => $data['billplz']['id'], + 'status' => 'UNSUCCESSFUL', + 'paid_at' => null + ]); + return redirect()->route('pay.failed'); + } + } + + public function response(Request $request){ + $http = new HttpMethodsClient( + new GuzzleHttpClient(), + new GuzzleMessageFactory() + ); + + $billplz = new Client($http, $this->api_key); + if(config('app.env') != 'production'){ + $billplz->useSandbox(); + } + $billplz->useVersion('v4'); + + $bill = $billplz->bill(); + + $data = $bill->webhook($request->toArray()); + if($data['billplz']['paid'] == 'true'){ + Http::put(config('api.url') . '/api/online/transaction',[ + 'billplz_id' => $data['billplz']['id'], + 'status' => 'PAID', + 'paid_at' => $data['billplz']['paid_at'] + ]); + + $transactionOnline = Http::get(config('api.url') . '/api/transaction/online/login',[ + 'billplz_id' => $data['billplz']['id'] + ])->json(); + + return redirect()->route('pay.success',[ + 'transactionOnline' => $transactionOnline + ]); + + }else{ + Http::put(config('api.url') . '/api/online/transaction',[ + 'billplz_id' => $data['billplz']['id'], + 'status' => 'UNSUCCESSFUL', + 'paid_at' => null + ]); + return redirect()->route('pay.failed'); + } + } + + public function successPayment(Request $request){ + $transactionOnline = $request->transactionOnline; + + // dd($transactionOnline); + + $arraygadai = array(); + $arraycawangan = array(); + // dd($transactionOnline); + foreach($transactionOnline as $index1=>$trans) + { + $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $trans['kodcaw'])->json(); + $cawangan = Http::get(config('api.url') . '/api/cawangan/detail/'. $trans['kodcaw'])->json(); + $cawangan_detail = $cawangan[0]; + $nama_cawangan = $cawangan_info['details_caw']; + $gadai = Http::get(config('api.url') .'/api/gadai/norujukan/'.$trans['norujukan'])->json(); + $gadai = $gadai[0][0]; + + array_push($arraygadai,$gadai); + array_push($arraycawangan,$cawangan_detail); + + + } + + // dd($arraygadai,$arraycawangan); + + // return view('pembayaran.result.berjaya',compact('transactionOnline','arraycawangan','arraygadai')); + return view('pembayaran.result.berjayaportal',compact('transactionOnline','arraycawangan','arraygadai')); + } + + public function failedPayment(){ + // return view('pembayaran.result.gagal'); + return view('pembayaran.result.gagalportal'); + } } \ No newline at end of file diff --git a/app/Http/Controllers/AuthMobile/LelongMobileController.php b/app/Http/Controllers/AuthMobile/LelongMobileController.php index 7e4da094..962eeb14 100644 --- a/app/Http/Controllers/AuthMobile/LelongMobileController.php +++ b/app/Http/Controllers/AuthMobile/LelongMobileController.php @@ -9,6 +9,7 @@ use App\Models\LelongBid; use App\Models\LelongBidMarhun; use App\Models\lelkarat; use Carbon\Carbon; +use App\Models\Cawangan; class LelongMobileController extends Controller { @@ -27,15 +28,16 @@ class LelongMobileController extends Controller ->get()->toArray(); $lelong[$index1]['lelongbid'] = $lelongbid; - + foreach($lelongbid as $index2=>$lelbidmarhun){ - + $cawangan = Cawangan::where('id','=',$lelbidmarhun['caw_id'])->first()->toArray(); // $id = lelongbid::first(); $lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $lelbidmarhun['id']) ->get()->toArray(); $lelong[$index1]['lelongbid'][$index2]['lelongbidmarhun'] = $lelongbidmarhun; + $lelong[$index1]['lelongbid'][$index2]['cawangan'] = $cawangan; } } diff --git a/app/Http/Controllers/CartController.php b/app/Http/Controllers/CartController.php index ff503093..77f359b0 100644 --- a/app/Http/Controllers/CartController.php +++ b/app/Http/Controllers/CartController.php @@ -42,9 +42,11 @@ class CartController extends Controller { $lelongbid = LelongBid::where('id',$cart['lelongbid_id'])->first()->toArray(); $marhun = LelongBidMarhun::where('lelongbid_id','=',$lelongbid['id'])->get()->toArray(); + $cawangan = Cawangan::where('id','=',$lelongbid['caw_id'])->first()->toArray(); $carts[$index]['datalelongbid'] = $lelongbid; $carts[$index]['datalelongbid']['lelongbidmarhun'] = $marhun; + $carts[$index]['datalelongbid']['cawangan'] = $cawangan; } diff --git a/composer.json b/composer.json index 5367d869..c25ad304 100644 --- a/composer.json +++ b/composer.json @@ -10,9 +10,11 @@ "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.0.1", "intervention/image": "^2.7", + "jomweb/billplz": "4.1", "laravel/framework": "^8.65", "laravel/sanctum": "^2.13", "laravel/tinker": "^2.5", + "php-http/guzzle7-adapter": "^1.0", "spatie/laravel-permission": "^5.3" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 05e3bbbf..47cc424e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f1a4693dce1d851ff833931d64de0180", + "content-hash": "c31afdc7c1e50fe368c759133eafd44f", "packages": [ { "name": "asm89/stack-cors", @@ -188,6 +188,72 @@ ], "time": "2021-08-15T20:50:18+00:00" }, + { + "name": "clue/stream-filter", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/clue/stream-filter.git", + "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/stream-filter/zipball/aeb7d8ea49c7963d3b581378955dbf5bc49aa320", + "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\StreamFilter\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "A simple and modern approach to stream filtering in PHP", + "homepage": "https://github.com/clue/php-stream-filter", + "keywords": [ + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" + ], + "support": { + "issues": "https://github.com/clue/stream-filter/issues", + "source": "https://github.com/clue/stream-filter/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2020-10-02T12:38:20+00:00" + }, { "name": "dflydev/dot-access-data", "version": "v3.0.1", @@ -1091,6 +1157,113 @@ ], "time": "2021-10-06T17:43:30+00:00" }, + { + "name": "http-interop/http-factory-guzzle", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/http-interop/http-factory-guzzle.git", + "reference": "8f06e92b95405216b237521cc64c804dd44c4a81" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/http-interop/http-factory-guzzle/zipball/8f06e92b95405216b237521cc64c804dd44c4a81", + "reference": "8f06e92b95405216b237521cc64c804dd44c4a81", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.7||^2.0", + "php": ">=7.3", + "psr/http-factory": "^1.0" + }, + "provide": { + "psr/http-factory-implementation": "^1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^9.5" + }, + "suggest": { + "guzzlehttp/psr7": "Includes an HTTP factory starting in version 2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Factory\\Guzzle\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "An HTTP Factory using Guzzle PSR7", + "keywords": [ + "factory", + "http", + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/http-interop/http-factory-guzzle/issues", + "source": "https://github.com/http-interop/http-factory-guzzle/tree/1.2.0" + }, + "time": "2021-07-21T13:50:14+00:00" + }, + { + "name": "igorw/get-in", + "version": "v1.0.3", + "source": { + "type": "git", + "url": "https://github.com/igorw/get-in.git", + "reference": "170ded831f49abc6a6061f655aba9bdbcf7b8111" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/get-in/zipball/170ded831f49abc6a6061f655aba9bdbcf7b8111", + "reference": "170ded831f49abc6a6061f655aba9bdbcf7b8111", + "shasum": "" + }, + "require": { + "php": ">=5.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "files": [ + "src/get_in.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Functions for for hash map (assoc array) traversal.", + "keywords": [ + "assoc-array", + "hash-map" + ], + "support": { + "issues": "https://github.com/igorw/get-in/issues", + "source": "https://github.com/igorw/get-in/tree/v1.0.3" + }, + "time": "2014-12-15T23:03:51+00:00" + }, { "name": "intervention/image", "version": "2.7.1", @@ -1175,6 +1348,115 @@ ], "time": "2021-12-16T16:49:26+00:00" }, + { + "name": "jomweb/billplz", + "version": "v4.1.0", + "source": { + "type": "git", + "url": "https://github.com/jomweb/billplz.git", + "reference": "6449dcbb1b89fd9d98c1d68235b3801b1dc4ee25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jomweb/billplz/zipball/6449dcbb1b89fd9d98c1d68235b3801b1dc4ee25", + "reference": "6449dcbb1b89fd9d98c1d68235b3801b1dc4ee25", + "shasum": "" + }, + "require": { + "jomweb/ringgit": "^2.1", + "laravie/codex": "^5.1", + "laravie/codex-filter": "^1.0", + "php": ">=7.2", + "php-http/multipart-stream-builder": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^1.3.1", + "php-http/curl-client": "^2.0", + "phpunit/phpunit": "^8.4 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Billplz\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mior Muhammad Zaki", + "email": "crynobone@gmail.com" + } + ], + "description": "PHP Agnostic library for working with BillPlz API", + "support": { + "issues": "https://github.com/jomweb/billplz/issues", + "source": "https://github.com/jomweb/billplz/tree/4.x" + }, + "time": "2020-02-17T14:15:32+00:00" + }, + { + "name": "jomweb/ringgit", + "version": "v2.4.1", + "source": { + "type": "git", + "url": "https://github.com/jomweb/ringgit.git", + "reference": "c9137299971e14652a9db0c8e73ff9d17c3075f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jomweb/ringgit/zipball/c9137299971e14652a9db0c8e73ff9d17c3075f3", + "reference": "c9137299971e14652a9db0c8e73ff9d17c3075f3", + "shasum": "" + }, + "require": { + "moneyphp/money": "^3.3 || ^4.0", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpunit/phpunit": "^8.5.21 || ^9.5.10 || ^10.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Duit\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mior Muhammad Zaki", + "email": "crynobone@gmail.com" + } + ], + "description": "Malaysia Ringgit implementation on top of Money PHP", + "support": { + "issues": "https://github.com/jomweb/ringgit/issues", + "source": "https://github.com/jomweb/ringgit/tree/v2.4.1" + }, + "funding": [ + { + "url": "https://paypal.me/crynobone", + "type": "custom" + }, + { + "url": "https://liberapay.com/crynobone", + "type": "liberapay" + } + ], + "time": "2021-12-14T12:34:10+00:00" + }, { "name": "laravel/framework", "version": "v8.70.2", @@ -1538,6 +1820,204 @@ }, "time": "2021-09-28T15:47:34+00:00" }, + { + "name": "laravie/codex", + "version": "v5.3.2", + "source": { + "type": "git", + "url": "https://github.com/laravie/codex.git", + "reference": "07fbd9ffd09303b4964d305ad0c2bc738327def7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravie/codex/zipball/07fbd9ffd09303b4964d305ad0c2bc738327def7", + "reference": "07fbd9ffd09303b4964d305ad0c2bc738327def7", + "shasum": "" + }, + "require": { + "laravie/codex-common": "^1.4.3", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.0.1", + "laravie/codex-filter": "^1.2.1", + "mockery/mockery": "^1.3.1", + "php-http/guzzle7-adapter": "^1.0", + "php-http/multipart-stream-builder": "^1.0", + "phpstan/phpstan": "^0.12.90", + "phpunit/phpunit": "^8.4 || ^9.3.3" + }, + "suggest": { + "laravie/codex-filter": "Content filtering for Laravie Codex (^1.0)", + "php-http/multipart-stream-builder": "Allow to send multipart form request (^1.0)", + "phpunit/phpunit": "Allow to use Codex Faker request during testing (^8.4 || ^9.0)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravie\\Codex\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mior Muhammad Zaki", + "email": "crynobone@gmail.com" + } + ], + "description": "PHP library for building API Client SDK for PHP", + "support": { + "issues": "https://github.com/laravie/codex/issues", + "source": "https://github.com/laravie/codex/tree/v5.3.2" + }, + "funding": [ + { + "url": "https://paypal.me/crynobone", + "type": "custom" + }, + { + "url": "https://liberapay.com/crynobone", + "type": "liberapay" + } + ], + "time": "2021-08-01T14:35:33+00:00" + }, + { + "name": "laravie/codex-common", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/laravie/codex-common.git", + "reference": "c843dcc1aefd326251d3415f3d74db1da2213e3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravie/codex-common/zipball/c843dcc1aefd326251d3415f3d74db1da2213e3e", + "reference": "c843dcc1aefd326251d3415f3d74db1da2213e3e", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.6 || ^2.0", + "http-interop/http-factory-guzzle": "^1.0", + "php": "^7.2 || ^8.0", + "php-http/client-common": "^2.0", + "php-http/client-implementation": "^1.0", + "php-http/discovery": "^1.13" + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.0.1", + "mockery/mockery": "~1.3.1 || ^1.4.4", + "php-http/guzzle7-adapter": "^1.0", + "phpstan/phpstan": "^1.0", + "phpunit/phpunit": "^8.5.21 || ^9.5.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Laravie\\Codex\\Common\\": "src/Common/", + "Laravie\\Codex\\Contracts\\": "src/Contracts/", + "Laravie\\Codex\\Exceptions\\": "src/Exceptions/", + "Laravie\\Codex\\Testing\\": "src/Testing/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mior Muhammad Zaki", + "email": "crynobone@gmail.com" + } + ], + "description": "Common PHP library for building API Client SDK for PHP", + "support": { + "issues": "https://github.com/laravie/codex-common/issues", + "source": "https://github.com/laravie/codex-common/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://paypal.me/crynobone", + "type": "custom" + }, + { + "url": "https://liberapay.com/crynobone", + "type": "liberapay" + } + ], + "time": "2022-01-06T03:05:05+00:00" + }, + { + "name": "laravie/codex-filter", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/laravie/codex-filter.git", + "reference": "a902b7ce2faef50ca97508569900a96488a35a9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravie/codex-filter/zipball/a902b7ce2faef50ca97508569900a96488a35a9e", + "reference": "a902b7ce2faef50ca97508569900a96488a35a9e", + "shasum": "" + }, + "require": { + "igorw/get-in": "^1.0", + "laravie/codex-common": "^1.4", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.3.1", + "php-http/guzzle7-adapter": "^0.1", + "phpstan/phpstan": "0.12.x-dev", + "phpunit/phpunit": "^8.4 || ^9.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravie\\Codex\\Filter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mior Muhammad Zaki", + "email": "crynobone@gmail.com" + } + ], + "description": "Content filtering for Laravie Codex", + "support": { + "issues": "https://github.com/laravie/codex-filter/issues", + "source": "https://github.com/laravie/codex-filter/tree/v1.2.1" + }, + "funding": [ + { + "url": "https://paypal.me/crynobone", + "type": "custom" + }, + { + "url": "https://liberapay.com/crynobone", + "type": "liberapay" + } + ], + "time": "2021-08-01T13:57:49+00:00" + }, { "name": "league/commonmark", "version": "2.0.2", @@ -1881,6 +2361,92 @@ ], "time": "2021-09-25T08:23:19+00:00" }, + { + "name": "moneyphp/money", + "version": "v3.3.1", + "source": { + "type": "git", + "url": "https://github.com/moneyphp/money.git", + "reference": "122664c2621a95180a13c1ac81fea1d2ef20781e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/moneyphp/money/zipball/122664c2621a95180a13c1ac81fea1d2ef20781e", + "reference": "122664c2621a95180a13c1ac81fea1d2ef20781e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.6" + }, + "require-dev": { + "cache/taggable-cache": "^0.4.0", + "doctrine/instantiator": "^1.0.5", + "ext-bcmath": "*", + "ext-gmp": "*", + "ext-intl": "*", + "florianv/exchanger": "^1.0", + "florianv/swap": "^3.0", + "friends-of-phpspec/phpspec-code-coverage": "^3.1.1 || ^4.3", + "moneyphp/iso-currencies": "^3.2.1", + "php-http/message": "^1.4", + "php-http/mock-client": "^1.0.0", + "phpspec/phpspec": "^3.4.3", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.18 || ^8.5", + "psr/cache": "^1.0", + "symfony/phpunit-bridge": "^4" + }, + "suggest": { + "ext-bcmath": "Calculate without integer limits", + "ext-gmp": "Calculate without integer limits", + "ext-intl": "Format Money objects with intl", + "florianv/exchanger": "Exchange rates library for PHP", + "florianv/swap": "Exchange rates library for PHP", + "psr/cache-implementation": "Used for Currency caching" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Money\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mathias Verraes", + "email": "mathias@verraes.net", + "homepage": "http://verraes.net" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "Frederik Bosch", + "email": "f.bosch@genkgo.nl" + } + ], + "description": "PHP implementation of Fowler's Money pattern", + "homepage": "http://moneyphp.org", + "keywords": [ + "Value Object", + "money", + "vo" + ], + "support": { + "issues": "https://github.com/moneyphp/money/issues", + "source": "https://github.com/moneyphp/money/tree/master" + }, + "time": "2020-03-18T17:49:59+00:00" + }, { "name": "monolog/monolog", "version": "2.3.5", @@ -2429,6 +2995,520 @@ }, "time": "2021-10-18T02:13:32+00:00" }, + { + "name": "php-http/client-common", + "version": "2.5.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/client-common.git", + "reference": "d135751167d57e27c74de674d6a30cef2dc8e054" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/client-common/zipball/d135751167d57e27c74de674d6a30cef2dc8e054", + "reference": "d135751167d57e27c74de674d6a30cef2dc8e054", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/httplug": "^2.0", + "php-http/message": "^1.6", + "php-http/message-factory": "^1.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0", + "symfony/polyfill-php80": "^1.17" + }, + "require-dev": { + "doctrine/instantiator": "^1.1", + "guzzlehttp/psr7": "^1.4", + "nyholm/psr7": "^1.2", + "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", + "phpspec/prophecy": "^1.10.2", + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" + }, + "suggest": { + "ext-json": "To detect JSON responses with the ContentTypePlugin", + "ext-libxml": "To detect XML responses with the ContentTypePlugin", + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Common HTTP Client implementations and tools for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "common", + "http", + "httplug" + ], + "support": { + "issues": "https://github.com/php-http/client-common/issues", + "source": "https://github.com/php-http/client-common/tree/2.5.0" + }, + "time": "2021-11-26T15:01:24+00:00" + }, + { + "name": "php-http/discovery", + "version": "1.14.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "de90ab2b41d7d61609f504e031339776bc8c7223" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/de90ab2b41d7d61609f504e031339776bc8c7223", + "reference": "de90ab2b41d7d61609f504e031339776bc8c7223", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "nyholm/psr7": "<1.0" + }, + "require-dev": { + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1", + "puli/composer-plugin": "1.0.0-beta10" + }, + "suggest": { + "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds installed HTTPlug implementations and PSR-7 message factories", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr7" + ], + "support": { + "issues": "https://github.com/php-http/discovery/issues", + "source": "https://github.com/php-http/discovery/tree/1.14.1" + }, + "time": "2021-09-18T07:57:46+00:00" + }, + { + "name": "php-http/guzzle7-adapter", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/guzzle7-adapter.git", + "reference": "fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/guzzle7-adapter/zipball/fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01", + "reference": "fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^7.0", + "php": "^7.2 | ^8.0", + "php-http/httplug": "^2.0", + "psr/http-client": "^1.0" + }, + "provide": { + "php-http/async-client-implementation": "1.0", + "php-http/client-implementation": "1.0", + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.0|^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Adapter\\Guzzle7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + } + ], + "description": "Guzzle 7 HTTP Adapter", + "homepage": "http://httplug.io", + "keywords": [ + "Guzzle", + "http" + ], + "support": { + "issues": "https://github.com/php-http/guzzle7-adapter/issues", + "source": "https://github.com/php-http/guzzle7-adapter/tree/1.0.0" + }, + "time": "2021-03-09T07:35:15+00:00" + }, + { + "name": "php-http/httplug", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "191a0a1b41ed026b717421931f8d3bd2514ffbf9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/191a0a1b41ed026b717421931f8d3bd2514ffbf9", + "reference": "191a0a1b41ed026b717421931f8d3bd2514ffbf9", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/promise": "^1.1", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.1", + "phpspec/phpspec": "^5.1 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "support": { + "issues": "https://github.com/php-http/httplug/issues", + "source": "https://github.com/php-http/httplug/tree/master" + }, + "time": "2020-07-13T15:43:23+00:00" + }, + { + "name": "php-http/message", + "version": "1.12.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/message.git", + "reference": "39eb7548be982a81085fe5a6e2a44268cd586291" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message/zipball/39eb7548be982a81085fe5a6e2a44268cd586291", + "reference": "39eb7548be982a81085fe5a6e2a44268cd586291", + "shasum": "" + }, + "require": { + "clue/stream-filter": "^1.5", + "php": "^7.1 || ^8.0", + "php-http/message-factory": "^1.0.2", + "psr/http-message": "^1.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.6", + "ext-zlib": "*", + "guzzlehttp/psr7": "^1.0", + "laminas/laminas-diactoros": "^2.0", + "phpspec/phpspec": "^5.1 || ^6.3", + "slim/slim": "^3.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "laminas/laminas-diactoros": "Used with Diactoros Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + }, + "files": [ + "src/filters.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTP Message related tools", + "homepage": "http://php-http.org", + "keywords": [ + "http", + "message", + "psr-7" + ], + "support": { + "issues": "https://github.com/php-http/message/issues", + "source": "https://github.com/php-http/message/tree/1.12.0" + }, + "time": "2021-08-29T09:13:12+00:00" + }, + { + "name": "php-http/message-factory", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message-factory.git", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Factory interfaces for PSR-7 HTTP Message", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "stream", + "uri" + ], + "support": { + "issues": "https://github.com/php-http/message-factory/issues", + "source": "https://github.com/php-http/message-factory/tree/master" + }, + "time": "2015-12-19T14:08:53+00:00" + }, + { + "name": "php-http/multipart-stream-builder", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/multipart-stream-builder.git", + "reference": "11c1d31f72e01c738bbce9e27649a7cca829c30e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/11c1d31f72e01c738bbce9e27649a7cca829c30e", + "reference": "11c1d31f72e01c738bbce9e27649a7cca829c30e", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/discovery": "^1.7", + "php-http/message-factory": "^1.0.2", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "nyholm/psr7": "^1.0", + "php-http/message": "^1.5", + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\MultipartStream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + } + ], + "description": "A builder class that help you create a multipart stream", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "multipart stream", + "stream" + ], + "support": { + "issues": "https://github.com/php-http/multipart-stream-builder/issues", + "source": "https://github.com/php-http/multipart-stream-builder/tree/1.2.0" + }, + "time": "2021-05-21T08:32:01+00:00" + }, + { + "name": "php-http/promise", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", + "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.3.2", + "phpspec/phpspec": "^5.1.2 || ^6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/php-http/promise/issues", + "source": "https://github.com/php-http/promise/tree/1.1.0" + }, + "time": "2020-07-07T09:29:14+00:00" + }, { "name": "phpoption/phpoption", "version": "1.8.0", @@ -4231,6 +5311,75 @@ ], "time": "2021-09-10T12:30:38+00:00" }, + { + "name": "symfony/options-resolver", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "b0fb78576487af19c500aaddb269fd36701d4847" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/b0fb78576487af19c500aaddb269fd36701d4847", + "reference": "b0fb78576487af19c500aaddb269fd36701d4847", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php73": "~1.0", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T10:19:22+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.23.0", From b403e509308e7f6fa4f602bc9be01eab0421f6cc Mon Sep 17 00:00:00 2001 From: faiqahzaman <91926774+faiqahzaman@users.noreply.github.com> Date: Tue, 25 Jan 2022 14:19:40 +0800 Subject: [PATCH 11/21] add model --- app/Models/lelongBidder.php | 26 ++++++++++++++++++++++++++ app/Models/payment.php | 29 +++++++++++++++++++++++++++++ app/Models/resit.php | 22 ++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 app/Models/lelongBidder.php create mode 100644 app/Models/payment.php create mode 100644 app/Models/resit.php diff --git a/app/Models/lelongBidder.php b/app/Models/lelongBidder.php new file mode 100644 index 00000000..5662beda --- /dev/null +++ b/app/Models/lelongBidder.php @@ -0,0 +1,26 @@ + Date: Tue, 25 Jan 2022 14:36:04 +0800 Subject: [PATCH 12/21] update table resit --- app/Http/Controllers/AuthMobile/LelongMobileController.php | 4 ++-- app/Models/resit.php | 4 +++- .../migrations/2022_01_25_010223_create_payment_table.php | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/AuthMobile/LelongMobileController.php b/app/Http/Controllers/AuthMobile/LelongMobileController.php index 408a46d7..0c83acbe 100644 --- a/app/Http/Controllers/AuthMobile/LelongMobileController.php +++ b/app/Http/Controllers/AuthMobile/LelongMobileController.php @@ -68,7 +68,7 @@ class LelongMobileController extends Controller $user_id = $user_id->tokenable_id; // !!!THIS ID WE CAN USE TO GET DATA OF YOUR USER!!! } - $feepayment = payment::where('fee' == 1)->first(); + $feepayment = payment::where('status', $status == 1)->first(); if($feepayment != null){ @@ -97,7 +97,7 @@ class LelongMobileController extends Controller $lelongBidder->save(); } - else if($feepayment == null){ + else if($status == null){ return response()->json("unsuccess", 201); } } diff --git a/app/Models/resit.php b/app/Models/resit.php index 304056da..883ced39 100644 --- a/app/Models/resit.php +++ b/app/Models/resit.php @@ -17,6 +17,8 @@ class resit extends Model 'reference_no', 'billplz_id', 'total_payment', - 'resit_type' + 'resit_type', // 1 = fee , 2 = bid + 'status', //status => 1 = paid , 2 = pending + 'paid_at' ]; } diff --git a/database/migrations/2022_01_25_010223_create_payment_table.php b/database/migrations/2022_01_25_010223_create_payment_table.php index 4f15579f..820df7af 100644 --- a/database/migrations/2022_01_25_010223_create_payment_table.php +++ b/database/migrations/2022_01_25_010223_create_payment_table.php @@ -48,9 +48,11 @@ class CreatePaymentTable extends Migration $table->unsignedBigInteger('user_id')->unsigned(); $table->unsignedBigInteger('lelongbid_id')->unsigned()->nullable(); $table->string('reference_no')->nullable(); - $table->integer('billplz_id'); - $table->string('total_payment'); + $table->string('billplz_id'); + $table->decimal('total_payment', $precision = 9, $scale = 2); $table->string('resit_type'); + $table->string('status')->nullable(); + $table->timestamp('paid_at')->nullable(); $table->timestamps(); $table->foreign('user_id') From 17c25cbbfb371822eda3ecc52b3635efc1d48017 Mon Sep 17 00:00:00 2001 From: Azfar Arsyad <45238748+Arpax17@users.noreply.github.com> Date: Tue, 25 Jan 2022 14:36:21 +0800 Subject: [PATCH 13/21] commit --- app/Http/Controllers/ApiController.php | 53 ++++++++++++++++---------- routes/api.php | 11 ++++++ 2 files changed, 43 insertions(+), 21 deletions(-) diff --git a/app/Http/Controllers/ApiController.php b/app/Http/Controllers/ApiController.php index 25f768d1..65b8f40b 100644 --- a/app/Http/Controllers/ApiController.php +++ b/app/Http/Controllers/ApiController.php @@ -33,6 +33,7 @@ use Money\Money; use Billplz\Client; use Http\Client\Common\HttpMethodsClient; use Http\Adapter\Guzzle7\Client as GuzzleHttpClient; +use Http\Message\MessageFactory\GuzzleMessageFactory; class ApiController extends Controller { @@ -121,7 +122,7 @@ class ApiController extends Controller } } - public function PembayaranEngine(Request $request) + public function feepayment(Request $request) { $arraycollection_id = array(); @@ -162,30 +163,40 @@ class ApiController extends Controller ); $billcode = $response->toArray(); + $reference_no = 'LPKB' . $day . $month . $year . sprintf("%08d", $nosiri); - foreach($array_payment as $index1=>$arraypay) - { - $previous_siri = Http::get(config('api.url') . '/api/online/transaction')->json(); - if($previous_siri){ - $nosiri = $previous_siri['nosiri'] + 1; - }else{ - $nosiri = 1; - } + $resit = new Resit; + $resit->user_id = $request->user_id; + $resit->lelongbid_id = $request->lelongbid_id; + $resit->reference_no = $reference_no; + $resit->billplz_id = $billcode['id']; + $resit->resit_type = 1; + $resit->total_payment = $total_bayaran; + $resit->save(); - $reference_no = 'LPKB' . $day . $month . $year . sprintf("%08d", $nosiri); + // foreach($array_payment as $index1=>$arraypay) + // { + // $previous_siri = Http::get(config('api.url') . '/api/online/transaction')->json(); + // if($previous_siri){ + // $nosiri = $previous_siri['nosiri'] + 1; + // }else{ + // $nosiri = 1; + // } - $new_transaction = Http::post(config('api.url') . '/api/online/transaction',[ - 'nokp'=> Auth::user()->icno, - 'reference_no'=> $reference_no, - 'nosiri'=> $nosiri, - 'billplz_id' => $billcode['id'], - 'norujukan' => $arraypay['norujukan'], - 'kodcaw' => $arraypay['kodcaw'], - 'total_payment'=> $arraypay['bayaran'], - 'customer_name' => Auth::user()->name, - ])->json(); + // $reference_no = 'LPKB' . $day . $month . $year . sprintf("%08d", $nosiri); - } + // $new_transaction = Http::post(config('api.url') . '/api/online/transaction',[ + // 'nokp'=> Auth::user()->icno, + // 'reference_no'=> $reference_no, + // 'nosiri'=> $nosiri, + // 'billplz_id' => $billcode['id'], + // 'norujukan' => $arraypay['norujukan'], + // 'kodcaw' => $arraypay['kodcaw'], + // 'total_payment'=> $arraypay['bayaran'], + // 'customer_name' => Auth::user()->name, + // ])->json(); + + // } return redirect($billcode['url'] . '?auto_submit=true'); diff --git a/routes/api.php b/routes/api.php index 451f406f..a1c07daf 100644 --- a/routes/api.php +++ b/routes/api.php @@ -6,6 +6,7 @@ use App\Http\Controllers\AuthMobile\AuthController; use App\Http\Controllers\AuthMobile\UserController; use App\Http\Controllers\AuthMobile\LelongMobileController; use App\Http\Controllers\CartController; +use App\Http\Controllers\ApiController; /* |-------------------------------------------------------------------------- @@ -24,6 +25,16 @@ Route::post('/login', [AuthController::class, 'login']); Route::post('/forgotpassword', [ResetPassword::class, 'forgotpassword']); Route::post('/addToCart', [CartController::class, 'addToCart']); Route::get('/cart/{userid}', [CartController::class, 'getCart']); + +Route::post('/feepayment', [ApiController::class, 'feepayment']); +Route::get('/callback', [ApiController::class, 'feepayment']); + +Route::post('/feepayment', 'App\Http\Controllers\ApiController@PembayaranEngine')->name('feepayment'); +Route::get('/pembayaran/response', 'App\Http\Controllers\ApiController@response')->name('pay.paymentStatus'); +Route::get('/pembayaran/backend', 'App\Http\Controllers\ApiController@callback')->name('pay.callback'); +Route::get('pembayaran/berjaya',['as'=>'pay.success','uses'=>'App\Http\Controllers\ApiController@successPayment']); +Route::get('pembayaran/gagal',['as'=>'pay.failed','uses'=>'App\Http\Controllers\ApiController@failedPayment']); + //Protected routes Route::group(['middleware' => ['auth:sanctum']], function () { From 0f66b280a832880f7baca27d55a45b662401e1dd Mon Sep 17 00:00:00 2001 From: Azfar Arsyad <45238748+Arpax17@users.noreply.github.com> Date: Tue, 25 Jan 2022 15:04:23 +0800 Subject: [PATCH 14/21] commit --- app/Http/Controllers/ApiController.php | 75 ++++++++------------------ routes/api.php | 2 - 2 files changed, 21 insertions(+), 56 deletions(-) diff --git a/app/Http/Controllers/ApiController.php b/app/Http/Controllers/ApiController.php index 65b8f40b..387dedd0 100644 --- a/app/Http/Controllers/ApiController.php +++ b/app/Http/Controllers/ApiController.php @@ -153,7 +153,7 @@ class ApiController extends Controller $response = $bill->create( $collection_id, - $request->email, + // $request->email, $request->notel, $request->name, Money::MYR($total_bayaran), @@ -167,7 +167,7 @@ class ApiController extends Controller $resit = new Resit; $resit->user_id = $request->user_id; - $resit->lelongbid_id = $request->lelongbid_id; + $resit->lelongbid_id = null; $resit->reference_no = $reference_no; $resit->billplz_id = $billcode['id']; $resit->resit_type = 1; @@ -221,27 +221,28 @@ class ApiController extends Controller $data = $bill->webhook($request->toArray()); if($data['billplz']['paid'] == 'true'){ - Http::put(config('api.url') . '/api/online/transaction',[ - 'billplz_id' => $data['billplz']['id'], - 'status' => 'PAID', - 'paid_at' => $data['billplz']['paid_at'] - ]); + $resit = Resit::where('billplz_id','=',$data['billplz']['id'])->first(); + $resit->status = 'PAID'; + $resit->paid_at = $data['billplz']['paid_at']; + $resit->save(); - $transactionOnline = Http::get(config('api.url') . '/api/transaction/online/express',[ - 'billplz_id' => $data['billplz']['id'] - ])->json(); - - return redirect()->route('pay.success',[ - 'transactionOnline' => $transactionOnline - ]); + // $transactionOnline = Http::get(config('api.url') . '/api/transaction/online/express',[ + // 'billplz_id' => $data['billplz']['id'] + // ])->json(); + return response()->json([ + 'success' => true, + 'resit' => $resit + ]); }else{ - Http::put(config('api.url') . '/api/online/transaction',[ - 'billplz_id' => $data['billplz']['id'], - 'status' => 'UNSUCCESSFUL', - 'paid_at' => null - ]); - return redirect()->route('pay.failed'); + $resit = Resit::where('billplz_id','=',$data['billplz']['id'])->first(); + $resit->status = 'UNSUCCESSFUL'; + $resit->paid_at = null; + $resit->save(); + return response()->json([ + 'success' => false, + 'resit' => $resit + ]); } } @@ -284,39 +285,5 @@ class ApiController extends Controller return redirect()->route('pay.failed'); } } - - public function successPayment(Request $request){ - $transactionOnline = $request->transactionOnline; - - // dd($transactionOnline); - - $arraygadai = array(); - $arraycawangan = array(); - // dd($transactionOnline); - foreach($transactionOnline as $index1=>$trans) - { - $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $trans['kodcaw'])->json(); - $cawangan = Http::get(config('api.url') . '/api/cawangan/detail/'. $trans['kodcaw'])->json(); - $cawangan_detail = $cawangan[0]; - $nama_cawangan = $cawangan_info['details_caw']; - $gadai = Http::get(config('api.url') .'/api/gadai/norujukan/'.$trans['norujukan'])->json(); - $gadai = $gadai[0][0]; - - array_push($arraygadai,$gadai); - array_push($arraycawangan,$cawangan_detail); - - - } - - // dd($arraygadai,$arraycawangan); - - // return view('pembayaran.result.berjaya',compact('transactionOnline','arraycawangan','arraygadai')); - return view('pembayaran.result.berjayaportal',compact('transactionOnline','arraycawangan','arraygadai')); - } - - public function failedPayment(){ - // return view('pembayaran.result.gagal'); - return view('pembayaran.result.gagalportal'); - } } \ No newline at end of file diff --git a/routes/api.php b/routes/api.php index a1c07daf..98777810 100644 --- a/routes/api.php +++ b/routes/api.php @@ -32,8 +32,6 @@ Route::get('/callback', [ApiController::class, 'feepayment']); Route::post('/feepayment', 'App\Http\Controllers\ApiController@PembayaranEngine')->name('feepayment'); Route::get('/pembayaran/response', 'App\Http\Controllers\ApiController@response')->name('pay.paymentStatus'); Route::get('/pembayaran/backend', 'App\Http\Controllers\ApiController@callback')->name('pay.callback'); -Route::get('pembayaran/berjaya',['as'=>'pay.success','uses'=>'App\Http\Controllers\ApiController@successPayment']); -Route::get('pembayaran/gagal',['as'=>'pay.failed','uses'=>'App\Http\Controllers\ApiController@failedPayment']); //Protected routes Route::group(['middleware' => ['auth:sanctum']], function () { From 8228e6c8c60bfd1c7138ba55ef48257287c65044 Mon Sep 17 00:00:00 2001 From: Azfar Arsyad <45238748+Arpax17@users.noreply.github.com> Date: Tue, 25 Jan 2022 16:11:00 +0800 Subject: [PATCH 15/21] merge --- app/Http/Controllers/ApiController.php | 53 ++++++++++++++++---------- routes/api.php | 6 +-- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/app/Http/Controllers/ApiController.php b/app/Http/Controllers/ApiController.php index 387dedd0..7278f59a 100644 --- a/app/Http/Controllers/ApiController.php +++ b/app/Http/Controllers/ApiController.php @@ -26,6 +26,7 @@ use App\Models\LelongBid; use App\Models\LelongBidMarhun; use App\Models\LelKarat; use App\Models\LelKarat_temp; +use App\Models\Resit; use Session; use Carbon\Carbon; @@ -49,7 +50,7 @@ class ApiController extends Controller * @return \Illuminate\Contracts\Support\Renderable */ public function __construct(){ - parent::__construct(); + // parent::__construct(); if(config('app.env') != 'production'){ $this->api_key = 'abecfd0c-98d8-4635-abc2-2fcba8c60c11'; $this->XSignature_Key = 'S-GWr7z03XjAhqPsFfu_H5nQ'; @@ -150,10 +151,11 @@ class ApiController extends Controller $total_bayaran = 10; - + $collection_id = $this->collection_id; + // dd($request->all()); $response = $bill->create( $collection_id, - // $request->email, + 'test@gmail.com', $request->notel, $request->name, Money::MYR($total_bayaran), @@ -162,6 +164,13 @@ class ApiController extends Controller ['redirect_url' => route('pay.paymentStatus')] ); + $previous_siri = Resit::orderBy('id','desc')->first(); + if($previous_siri){ + $nosiri = $previous_siri->id + 1; + }else{ + $nosiri = 1; + } + $billcode = $response->toArray(); $reference_no = 'LPKB' . $day . $month . $year . sprintf("%08d", $nosiri); @@ -261,28 +270,30 @@ class ApiController extends Controller $bill = $billplz->bill(); $data = $bill->webhook($request->toArray()); + if($data['billplz']['paid'] == 'true'){ - Http::put(config('api.url') . '/api/online/transaction',[ - 'billplz_id' => $data['billplz']['id'], - 'status' => 'PAID', - 'paid_at' => $data['billplz']['paid_at'] - ]); + $resit = Resit::where('billplz_id','=',$data['billplz']['id'])->first(); + $resit->status = 'PAID'; + $resit->paid_at = $data['billplz']['paid_at']; + $resit->save(); - $transactionOnline = Http::get(config('api.url') . '/api/transaction/online/login',[ - 'billplz_id' => $data['billplz']['id'] - ])->json(); - - return redirect()->route('pay.success',[ - 'transactionOnline' => $transactionOnline - ]); + // $transactionOnline = Http::get(config('api.url') . '/api/transaction/online/express',[ + // 'billplz_id' => $data['billplz']['id'] + // ])->json(); + return response()->json([ + 'success' => true, + 'resit' => $resit + ]); }else{ - Http::put(config('api.url') . '/api/online/transaction',[ - 'billplz_id' => $data['billplz']['id'], - 'status' => 'UNSUCCESSFUL', - 'paid_at' => null - ]); - return redirect()->route('pay.failed'); + $resit = Resit::where('billplz_id','=',$data['billplz']['id'])->first(); + $resit->status = 'UNSUCCESSFUL'; + $resit->paid_at = null; + $resit->save(); + return response()->json([ + 'success' => false, + 'resit' => $resit + ]); } } } diff --git a/routes/api.php b/routes/api.php index 98777810..93e68187 100644 --- a/routes/api.php +++ b/routes/api.php @@ -29,9 +29,9 @@ Route::get('/cart/{userid}', [CartController::class, 'getCart']); Route::post('/feepayment', [ApiController::class, 'feepayment']); Route::get('/callback', [ApiController::class, 'feepayment']); -Route::post('/feepayment', 'App\Http\Controllers\ApiController@PembayaranEngine')->name('feepayment'); -Route::get('/pembayaran/response', 'App\Http\Controllers\ApiController@response')->name('pay.paymentStatus'); -Route::get('/pembayaran/backend', 'App\Http\Controllers\ApiController@callback')->name('pay.callback'); +Route::post('/feepayment', [ApiController::class, 'feepayment'])->name('feepayment'); +Route::get('/pembayaran/response', [ApiController::class, 'response'])->name('pay.paymentStatus'); +Route::get('/pembayaran/backend', [ApiController::class, 'callback'])->name('pay.callback'); //Protected routes Route::group(['middleware' => ['auth:sanctum']], function () { From d73884f4175d364ed8f80920faa1174eeca4eca5 Mon Sep 17 00:00:00 2001 From: faiqahzaman <91926774+faiqahzaman@users.noreply.github.com> Date: Tue, 25 Jan 2022 16:12:52 +0800 Subject: [PATCH 16/21] update model & select bid item --- .../AuthMobile/LelongMobileController.php | 42 ++++++++++--------- app/Models/lelongBidder.php | 2 +- app/Models/payment.php | 2 +- app/Models/resit.php | 2 +- ...01_23_042652_create_lelongbidder_table.php | 4 +- ...2022_01_25_010223_create_payment_table.php | 4 +- 6 files changed, 29 insertions(+), 27 deletions(-) diff --git a/app/Http/Controllers/AuthMobile/LelongMobileController.php b/app/Http/Controllers/AuthMobile/LelongMobileController.php index 0c83acbe..cf9e7578 100644 --- a/app/Http/Controllers/AuthMobile/LelongMobileController.php +++ b/app/Http/Controllers/AuthMobile/LelongMobileController.php @@ -11,6 +11,7 @@ use App\Models\LelongBidMarhun; use App\Models\lelkarat; use App\Models\User; use App\Models\Payment; +use App\Models\Cart; use Carbon\Carbon; use App\Models\Cawangan; @@ -61,43 +62,44 @@ class LelongMobileController extends Controller public function bidderSelectBidItem(Request $request){ - $post_data = $request->all(); - if (isset($post_data['user_token'])) { - [$id, $user_token] = explode('|', $post_data['user_token'], 2); - $token_data = DB::table('personal_access_tokens')->where('token', hash('sha256', $partner_token))->first(); - $user_id = $user_id->tokenable_id; // !!!THIS ID WE CAN USE TO GET DATA OF YOUR USER!!! - } + // $feepayment = Payment::select('status') + // ->where('status', 1) + // ->first(); - $feepayment = payment::where('status', $status == 1)->first(); + $feepayment = Payment::where('status', '=', 1)->first(); if($feepayment != null){ - $selectBid = Lelong::join('lelongbid', 'lelong.id', '=', 'lelongbid.lelong_id') - ->join('cart', 'lelongbid.id', '=', 'cart.lelongbid_id') - ->where('norujukan', $request->norujukan) + $user = User::where('id', '=', $request->user_id) + ->first(); + + $selectBid = Cart::join('lelongbid', 'carts.lelongbid_id', '=', 'lelongbid.id') + ->where('lelongbid.norujukan', $request->norujukan) ->select('lelongbid.id as lelongbid_id', 'lelongbid.t_lelong', 'lelongbid.nilaimarhun', 'lelongbid.cajlelong', - 'cart.hargabida') + 'carts.hargabida') ->get(); + // dd($selectBid[0]->hargabida); + $currentdate = Carbon::now()->toDateTimeString(); $lelongBidder = new LelongBidder(); - $lelongBidder->nama_bidder = $fields['nama_bidder']; - $lelongBidder->hargabida = $selectBid; - $lelongBidder->t_lelong = $selectBid; - $lelongBidder->lelongbid_id = $selectBid; - $lelongBidder->nilaimarhun = $selectBid; - $lelongBidder->cajlelong = $selectBid; - $lelongBidder->status_bidder = $fields['status_bidder']; - $lelongBidder->status_payment = $fields['status_payment']; + $lelongBidder->nama_bidder = $request->name; + $lelongBidder->user_id = $user->id; + $lelongBidder->notelbimbit = $user->notelbimbit; + $lelongBidder->hargabida = $selectBid[0]->hargabida; + $lelongBidder->lelongbid_id = $selectBid[0]->lelongbid_id; + $lelongBidder->nilaimarhun = $selectBid[0]->nilaimarhun; + $lelongBidder->cajlelong = $selectBid[0]->cajlelong; $lelongBidder->masa_bidaan = $currentdate; $lelongBidder->save(); + return response()->json("success", 201); } - else if($status == null){ + else if($feepayment == null){ return response()->json("unsuccess", 201); } } diff --git a/app/Models/lelongBidder.php b/app/Models/lelongBidder.php index 5662beda..c739a829 100644 --- a/app/Models/lelongBidder.php +++ b/app/Models/lelongBidder.php @@ -9,7 +9,7 @@ class lelongBidder extends Model { use HasFactory; - protected $table = 'lelongbid'; + protected $table = 'lelongbidder'; protected $fillable = [ 'user_id', diff --git a/app/Models/payment.php b/app/Models/payment.php index b772f2b2..c15ecd7a 100644 --- a/app/Models/payment.php +++ b/app/Models/payment.php @@ -9,7 +9,7 @@ class payment extends Model { use HasFactory; - protected $table = 'lelongbid'; + protected $table = 'payment'; protected $fillable = [ 'user_id', diff --git a/app/Models/resit.php b/app/Models/resit.php index 883ced39..9d59ce59 100644 --- a/app/Models/resit.php +++ b/app/Models/resit.php @@ -9,7 +9,7 @@ class resit extends Model { use HasFactory; - protected $table = 'lelongbid'; + protected $table = 'resit'; protected $fillable = [ 'user_id', diff --git a/database/migrations/2022_01_23_042652_create_lelongbidder_table.php b/database/migrations/2022_01_23_042652_create_lelongbidder_table.php index d790692a..1dd723f7 100644 --- a/database/migrations/2022_01_23_042652_create_lelongbidder_table.php +++ b/database/migrations/2022_01_23_042652_create_lelongbidder_table.php @@ -22,8 +22,8 @@ class CreateLelongbidderTable extends Migration $table->string('notelbimbit'); $table->decimal('nilaimarhun'); $table->decimal('cajlelong'); - $table->integer('status_bidder')->nullable(); - $table->integer('status_payment')->nullable(); + $table->integer('status_bidder')->nullable(); //1 = win + $table->integer('status_payment')->nullable(); // 1=paid $table->datetime('masa_bidaan'); $table->timestamps(); diff --git a/database/migrations/2022_01_25_010223_create_payment_table.php b/database/migrations/2022_01_25_010223_create_payment_table.php index 820df7af..8b2c057e 100644 --- a/database/migrations/2022_01_25_010223_create_payment_table.php +++ b/database/migrations/2022_01_25_010223_create_payment_table.php @@ -50,8 +50,8 @@ class CreatePaymentTable extends Migration $table->string('reference_no')->nullable(); $table->string('billplz_id'); $table->decimal('total_payment', $precision = 9, $scale = 2); - $table->string('resit_type'); - $table->string('status')->nullable(); + $table->string('resit_type'); // 1 = fee , 2 = bid + $table->string('status')->nullable(); //status => 1 = paid , 2 = pending $table->timestamp('paid_at')->nullable(); $table->timestamps(); From ecc9393cf737f658adbef0f99df548ff82166230 Mon Sep 17 00:00:00 2001 From: faiqahzaman <91926774+faiqahzaman@users.noreply.github.com> Date: Tue, 25 Jan 2022 16:42:34 +0800 Subject: [PATCH 17/21] get list bid item by user --- .../AuthMobile/LelongMobileController.php | 20 +++++++++++++++---- routes/api.php | 17 +++++++++++----- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/AuthMobile/LelongMobileController.php b/app/Http/Controllers/AuthMobile/LelongMobileController.php index cf9e7578..6c1c7202 100644 --- a/app/Http/Controllers/AuthMobile/LelongMobileController.php +++ b/app/Http/Controllers/AuthMobile/LelongMobileController.php @@ -62,10 +62,6 @@ class LelongMobileController extends Controller public function bidderSelectBidItem(Request $request){ - // $feepayment = Payment::select('status') - // ->where('status', 1) - // ->first(); - $feepayment = Payment::where('status', '=', 1)->first(); if($feepayment != null){ @@ -103,4 +99,20 @@ class LelongMobileController extends Controller return response()->json("unsuccess", 201); } } + + public function listBidItem(Request $request){ + + $lelongbidder = LelongBidder::where('user_id','=', $request->user_id) + ->get()->toArray(); + + foreach($lelongbidder as $index1=>$lelbid) + { + $lelongbid = LelongBid::whereIn('id',$lelongbidder) + ->get()->toArray(); + + $lelongbidder[$index1]['lelongbid'] = $lelongbid; + } + + return response()->json($lelongbidder); + } } diff --git a/routes/api.php b/routes/api.php index 98777810..e95749ee 100644 --- a/routes/api.php +++ b/routes/api.php @@ -36,20 +36,27 @@ Route::get('/pembayaran/backend', 'App\Http\Controllers\ApiController@callback') //Protected routes Route::group(['middleware' => ['auth:sanctum']], function () { + // User Route::post('/logout', [AuthController::class, 'logout']); Route::get('/user/profile/{nokp}', [UserController::class, 'getProfileUser']); - - - - Route::post('/updateItem', [CartController::class, 'updateItem']); - Route::get('/deleteItem/{id}', [CartController::class, 'deleteCart']); Route::post('/forgotPassword', [NewPasswordController::class, 'forgotPassword']); Route::post('/reset', [NewPasswordController::class, 'reset']); + + // User Profile Route::get('/user/profile', [UserController::class, 'getProfileUser']); Route::put('/userUpdate/profile', [UserController::class, 'updateProfileUser']); + + // Cart + Route::post('/updateItem', [CartController::class, 'updateItem']); + Route::get('/deleteItem/{id}', [CartController::class, 'deleteCart']); + + // Lelong Route::get('/lelongDetails/today', [LelongMobileController::class, 'getlelongdetails']); Route::get('/karat', [LelongMobileController::class, 'getListKarat']); + + // Lelong => Bidder Route::post('/bidder/biditem', [LelongMobileController::class, 'bidderSelectBidItem']); + Route::get('/bidder/listbiditem', [LelongMobileController::class, 'listBidItem']); }); From 5152019e61c872dc1ae8ee1fd40cd686d0fd4240 Mon Sep 17 00:00:00 2001 From: faiqahzaman <91926774+faiqahzaman@users.noreply.github.com> Date: Wed, 26 Jan 2022 09:55:56 +0800 Subject: [PATCH 18/21] search lelong details by cawangan id --- .../AuthMobile/LelongMobileController.php | 34 +++++++++++++++++++ routes/api.php | 1 + 2 files changed, 35 insertions(+) diff --git a/app/Http/Controllers/AuthMobile/LelongMobileController.php b/app/Http/Controllers/AuthMobile/LelongMobileController.php index 6c1c7202..593cc723 100644 --- a/app/Http/Controllers/AuthMobile/LelongMobileController.php +++ b/app/Http/Controllers/AuthMobile/LelongMobileController.php @@ -115,4 +115,38 @@ class LelongMobileController extends Controller return response()->json($lelongbidder); } + + public function searchLelByCaw(Request $request){ + + $currentdate = Carbon::now(); + $currentdate = $currentdate->toDateString(); + + // $arrayLelong = []; + $lelong = Lelong::join('cawangan_lelong', 'lelong.id', '=', 'cawangan_lelong.lelong_id') + ->where('tarikh_lelong','=',$currentdate) + ->where('caw_id', '=', $request->caw_id) + ->get()->toArray(); + + foreach($lelong as $index1=>$lel) + { + $lelongbid = LelongBid::where('lelong_id',$lel['lelong_id']) + ->get()->toArray(); + + $lelong[$index1]['lelongbid'] = $lelongbid; + + foreach($lelongbid as $index2=>$lelbidmarhun){ + $cawangan = Cawangan::where('id','=',$lelbidmarhun['caw_id'])->first()->toArray(); + // $id = lelongbid::first(); + + $lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $lelbidmarhun['id']) + ->get()->toArray(); + + $lelong[$index1]['lelongbid'][$index2]['lelongbidmarhun'] = $lelongbidmarhun; + $lelong[$index1]['lelongbid'][$index2]['cawangan'] = $cawangan; + } + + } + + return response()->json($lelong); + } } diff --git a/routes/api.php b/routes/api.php index e95749ee..980ca988 100644 --- a/routes/api.php +++ b/routes/api.php @@ -52,6 +52,7 @@ Route::group(['middleware' => ['auth:sanctum']], function () { // Lelong Route::get('/lelongDetails/today', [LelongMobileController::class, 'getlelongdetails']); + Route::get('/lelongDetails/cawangan', [LelongMobileController::class, 'searchLelByCaw']); Route::get('/karat', [LelongMobileController::class, 'getListKarat']); // Lelong => Bidder From 179e1794ddacb784f57857b7efec51ac221cee7f Mon Sep 17 00:00:00 2001 From: Azfar Arsyad <45238748+Arpax17@users.noreply.github.com> Date: Wed, 26 Jan 2022 14:54:21 +0800 Subject: [PATCH 19/21] commit --- app/Http/Controllers/ApiController.php | 35 +++++++++++++++----------- routes/api.php | 4 +-- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/app/Http/Controllers/ApiController.php b/app/Http/Controllers/ApiController.php index 7278f59a..9cc22f7e 100644 --- a/app/Http/Controllers/ApiController.php +++ b/app/Http/Controllers/ApiController.php @@ -27,6 +27,7 @@ use App\Models\LelongBidMarhun; use App\Models\LelKarat; use App\Models\LelKarat_temp; use App\Models\Resit; +use App\Models\Payment; use Session; use Carbon\Carbon; @@ -149,10 +150,9 @@ class ApiController extends Controller $month = $current->month; $year = $current->format('y'); - $total_bayaran = 10; + $total_bayaran = 1000; $collection_id = $this->collection_id; - // dd($request->all()); $response = $bill->create( $collection_id, 'test@gmail.com', @@ -160,8 +160,8 @@ class ApiController extends Controller $request->name, Money::MYR($total_bayaran), route('pay.callback'), - 'Bayaran Ansuran', - ['redirect_url' => route('pay.paymentStatus')] + 'Bayaran Borang', + ['redirect_url' => 'http://192.168.0.10:8003/api/pembayaran/response'] ); $previous_siri = Resit::orderBy('id','desc')->first(); @@ -170,17 +170,21 @@ class ApiController extends Controller }else{ $nosiri = 1; } - + $billcode = $response->toArray(); + // dd($billcode); + // $billcode['redirect_url'] = 'http://192.168.0.10:8003/api/pembayaran/response'; + // dd($billcode); $reference_no = 'LPKB' . $day . $month . $year . sprintf("%08d", $nosiri); - + // $response2 = $bill->get($billcode['id']); + // dd($response2->toArray()); $resit = new Resit; $resit->user_id = $request->user_id; $resit->lelongbid_id = null; $resit->reference_no = $reference_no; $resit->billplz_id = $billcode['id']; $resit->resit_type = 1; - $resit->total_payment = $total_bayaran; + $resit->total_payment = 10; $resit->save(); // foreach($array_payment as $index1=>$arraypay) @@ -214,6 +218,7 @@ class ApiController extends Controller } public function callback(Request $request){ + dd('hye'); $http = new HttpMethodsClient( new GuzzleHttpClient(), new GuzzleMessageFactory() @@ -256,6 +261,7 @@ class ApiController extends Controller } public function response(Request $request){ + // dd($request->all()); $http = new HttpMethodsClient( new GuzzleHttpClient(), new GuzzleMessageFactory() @@ -268,13 +274,14 @@ class ApiController extends Controller $billplz->useVersion('v4'); $bill = $billplz->bill(); - - $data = $bill->webhook($request->toArray()); - - if($data['billplz']['paid'] == 'true'){ - $resit = Resit::where('billplz_id','=',$data['billplz']['id'])->first(); + $req = $request->toArray(); + $response = $bill->get($req['billplz']['id']); + $data = $response->toArray(); + // dd($data); + if($data['paid'] == 'true'){ + $resit = Resit::where('billplz_id','=',$data['id'])->first(); $resit->status = 'PAID'; - $resit->paid_at = $data['billplz']['paid_at']; + $resit->paid_at = $data['paid_at']; $resit->save(); // $transactionOnline = Http::get(config('api.url') . '/api/transaction/online/express',[ @@ -286,7 +293,7 @@ class ApiController extends Controller ]); }else{ - $resit = Resit::where('billplz_id','=',$data['billplz']['id'])->first(); + $resit = Resit::where('billplz_id','=',$data['id'])->first(); $resit->status = 'UNSUCCESSFUL'; $resit->paid_at = null; $resit->save(); diff --git a/routes/api.php b/routes/api.php index 93e68187..0c15c6fd 100644 --- a/routes/api.php +++ b/routes/api.php @@ -26,8 +26,8 @@ Route::post('/forgotpassword', [ResetPassword::class, 'forgotpassword']); Route::post('/addToCart', [CartController::class, 'addToCart']); Route::get('/cart/{userid}', [CartController::class, 'getCart']); -Route::post('/feepayment', [ApiController::class, 'feepayment']); -Route::get('/callback', [ApiController::class, 'feepayment']); +// Route::post('/feepayment', [ApiController::class, 'feepayment']); +// Route::get('/callback', [ApiController::class, 'feepayment']); Route::post('/feepayment', [ApiController::class, 'feepayment'])->name('feepayment'); Route::get('/pembayaran/response', [ApiController::class, 'response'])->name('pay.paymentStatus'); From 0167637e27a72d9cf4e097bf5633eaa9192e8801 Mon Sep 17 00:00:00 2001 From: Azfar Arsyad <45238748+Arpax17@users.noreply.github.com> Date: Tue, 8 Feb 2022 12:52:20 +0800 Subject: [PATCH 20/21] commit --- .../Controllers/AuthMobile/AuthController.php | 22 ++- app/Http/Controllers/LelongController.php | 10 +- app/Http/Controllers/PembidaController.php | 93 ++++++++++++ .../2014_10_12_000000_create_users_table.php | 2 +- ...2022_01_25_010223_create_payment_table.php | 2 +- resources/views/includes/sidebar.blade.php | 3 + .../views/lelong/senarailelong.blade.php | 7 +- .../views/pembida/senaraipembida.blade.php | 134 ++++++++++++++++++ resources/views/pembida/show.blade.php | 83 +++++++++++ routes/web.php | 7 + 10 files changed, 357 insertions(+), 6 deletions(-) create mode 100644 app/Http/Controllers/PembidaController.php create mode 100644 resources/views/pembida/senaraipembida.blade.php create mode 100644 resources/views/pembida/show.blade.php diff --git a/app/Http/Controllers/AuthMobile/AuthController.php b/app/Http/Controllers/AuthMobile/AuthController.php index 5f2a1c3a..96d961e6 100644 --- a/app/Http/Controllers/AuthMobile/AuthController.php +++ b/app/Http/Controllers/AuthMobile/AuthController.php @@ -19,6 +19,7 @@ class AuthController extends Controller 'username' => 'required|string|unique:users', 'nokp' => 'required|string|unique:users', 'password' => 'required|string|min:8', + 'email' => 'required|string|unique:users|email', 'notelbimbit' => 'required|string|unique:users', 'register_agree' => 'required|integer' @@ -45,6 +46,7 @@ class AuthController extends Controller $user->username = $fields['username']; $user->nokp = $fields['nokp']; $user->password = bcrypt($fields['password']); + $user->email = $fields['email']; $user->notelbimbit = $fields['notelbimbit']; $user->register_agree = $fields['register_agree']; $user->t_daftar = $currentdate; @@ -85,7 +87,25 @@ class AuthController extends Controller //Check username $user = User::where('username', $fields['username'])->first(); - + + if($user->status != 'active') + { + if($user->status == 'banned') + { + return response([ + 'message' => 'User Banned' + ], 401); + } + else + { + return response([ + 'message' => 'Registration in progress,status wait for approval.' + ], 401); + } + return response([ + 'message' => 'Bad Creds' + ], 401); + } //Check Password if(!$user || !Hash::check($fields['password'], $user->password)){ return response([ diff --git a/app/Http/Controllers/LelongController.php b/app/Http/Controllers/LelongController.php index ceab41cf..eaa4bd7f 100644 --- a/app/Http/Controllers/LelongController.php +++ b/app/Http/Controllers/LelongController.php @@ -27,6 +27,9 @@ use App\Models\LelongBidMarhun; use App\Models\LelKarat; use App\Models\LelKarat_temp; + +use Carbon\Carbon; + class LelongController extends Controller { /** @@ -333,8 +336,13 @@ class LelongController extends Controller public function start($id) { + $currentdate = Carbon::now(); + $currenttime = $currentdate->toTimeString(); + $endtime = $currentdate->addHours(2); + $lelong = Lelong::where('id','=',$id)->first(); - $lelong->masatamat_lelong = '2021-12-20 04:51:50'; + $lelong->masamula_lelong = $currenttime; + $lelong->masatamat_lelong = $endtime->toTimeString(); $lelong->sts_lelong = 1; $lelong->save(); diff --git a/app/Http/Controllers/PembidaController.php b/app/Http/Controllers/PembidaController.php new file mode 100644 index 00000000..b37f6fdb --- /dev/null +++ b/app/Http/Controllers/PembidaController.php @@ -0,0 +1,93 @@ +middleware('auth'); + } + + /** + * Show the application dashboard. + * + * @return \Illuminate\Contracts\Support\Renderable + */ + public function index() + { + // $alluser = User::all(); + $alluser = User::doesntHave('roles')->where('user_type','=',2)->get(); + // $allroles = Role::all()->pluck('name'); + // $user = Auth::user(); + // $user->assignRole('admin'); + return view('pembida.senaraipembida',compact('alluser')); + } + + public function show($userid) + { + // dd($userid); + $user = User::where('id','=',$userid)->first(); + $files = File::where('user_id','=',$userid)->get()->toArray(); + + $array_ic = []; + foreach($files as $index=>$file) + { + $files[$index]['ic64']= 'data:image/' . $file['file_type'] . ';base64,' . base64_encode($file['filename']); + } + + // dd($files); + return view('pembida.show',compact('user','files')); + } + + + + public function delete(Request $request) + { + $user = User::where('id','=',$request->userid)->first(); + $user->note =$request->note; + $user->status = 'Fail'; + $user->save(); + + return redirect()->route('pembida.senaraipembida') + ->with('success','Padam Pengguna Berjaya'); + } + + public function sah($userid) + { + $currentdate = Carbon::now(); + $currentdate = $currentdate->toDateString(); + + $user = User::where('id','=',$userid)->first(); + $user->disahkan_pada = $currentdate; + $user->disahkan_oleh = Auth::user()->id; + $user->status = 'active'; + + if($user->save()) + { + $user->assignRole('pembida'); + } + + return redirect()->route('pembida.senaraipembida') + ->with('success','Pengesahan Berjaya'); + } + + + +} + \ No newline at end of file diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 64149651..ab6229ba 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -33,7 +33,7 @@ class CreateUsersTable extends Migration $table->datetime('email_verified_at')->nullable(); $table->string('password'); $table->datetime('disahkan_pada')->nullable(); - $table->datetime('disahkan_oleh')->nullable(); + $table->integer('disahkan_oleh')->nullable(); $table->string('user_type')->nullable(); //set 1,2 $table->rememberToken(); $table->timestamps(); diff --git a/database/migrations/2022_01_25_010223_create_payment_table.php b/database/migrations/2022_01_25_010223_create_payment_table.php index 8b2c057e..60fcc5a4 100644 --- a/database/migrations/2022_01_25_010223_create_payment_table.php +++ b/database/migrations/2022_01_25_010223_create_payment_table.php @@ -24,7 +24,7 @@ class CreatePaymentTable extends Migration $table->string('bank_acc_no_pembeli')->nullable(); $table->string('nama_bank_acc_caw')->nullable(); $table->string('bank_no_acc_caw')->nullable(); - $table->integer('status_payment_opt')->nullable(); + $table->integer('status_payment_opt')->nullable(); //1=online,2=kaunter $table->integer('resit_id'); $table->integer('status'); //1 = fee RM10 , 2 = paybidifwin $table->string('remark'); diff --git a/resources/views/includes/sidebar.blade.php b/resources/views/includes/sidebar.blade.php index 14e1e662..bd5decd1 100644 --- a/resources/views/includes/sidebar.blade.php +++ b/resources/views/includes/sidebar.blade.php @@ -86,6 +86,9 @@ +
  • + Pengesahan Pembida Baharu +
  • @endhasrole @hasrole('account') {{--
  • diff --git a/resources/views/lelong/senarailelong.blade.php b/resources/views/lelong/senarailelong.blade.php index 49b66163..ec39972a 100644 --- a/resources/views/lelong/senarailelong.blade.php +++ b/resources/views/lelong/senarailelong.blade.php @@ -36,14 +36,17 @@ {{ $lel->cajlelong }} @hasrole('jurulelong') - + @if(!$lel->masatamat_lelong) + + + @elseif ($lel->sts_lelong == 2) + @else @endif - @endhasrole diff --git a/resources/views/pembida/senaraipembida.blade.php b/resources/views/pembida/senaraipembida.blade.php new file mode 100644 index 00000000..a5bd2cc3 --- /dev/null +++ b/resources/views/pembida/senaraipembida.blade.php @@ -0,0 +1,134 @@ +@extends('layouts.app') + +@section('content') +
    +
    +
    + + @if ($message = Session::get('success')) +
    +

    {{ $message }}

    +
    + @endif + +
    + @csrf + + + + + + + + + + + + + + + @foreach ($alluser as $user) + + + + + + + + + @endforeach + + +
    NamaNumber PhoneEmailStatusAction
    {{ $user->name }}{{ $user->notelbimbit }}{{ $user->email }} + @if ($user->status =='active') + + @elseif ($user->status =='banned') + + @endif + + + + {{-- --}} +
    +
    +
    + +
    +
    + + +@endsection diff --git a/resources/views/pembida/show.blade.php b/resources/views/pembida/show.blade.php new file mode 100644 index 00000000..ce4a88da --- /dev/null +++ b/resources/views/pembida/show.blade.php @@ -0,0 +1,83 @@ +@extends('layouts.app') + +@section('content') +
    +
    +
    + @if ($message = Session::get('success')) +
    +

    {{ $message }}

    +
    + @endif +
    + @csrf +
    +
    + + +
    +
    + + +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    +

    Identity Card/Passport Picture

    +
    + @foreach ($files as $file) +
    + + + {{$file['ic64']}} +
    + @endforeach +
    +
    +
    + + Kembali + +
    + +
    + {{-- --}} +
    +
    +
    + +@endsection diff --git a/routes/web.php b/routes/web.php index 2dc0c6b7..fb02148c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -110,4 +110,11 @@ Route::group(['middleware' => ['permission:semakanmarhun','permission:kemaskinim Route::post('/kemaskini',['as'=>'marhun.kemaskini','uses'=>'MarhunController@kemaskini']); Route::get('/semakan',['as'=>'marhun.semakan','uses'=>'MarhunController@semakan']); +}); + +Route::group(['middleware' => ['permission:pengesahanpembida'],'prefix'=>'pembida'], function () { + Route::get('/senaraipembida',['as'=>'pembida.senaraipembida','uses'=>'PembidaController@index']); + Route::get('/pembida/{id}',['as'=>'pembida.show','uses'=>'PembidaController@show']); + Route::get('/deletepembida/{id}',['as'=>'pembida.delete','uses'=>'PembidaController@delete']); + Route::get('/sahkanpembida/{id}',['as'=>'pembida.sah','uses'=>'PembidaController@sah']); }); \ No newline at end of file From 5dd7fe170426d62dfb41c8827fbe1f143779d225 Mon Sep 17 00:00:00 2001 From: Azfar Arsyad <45238748+Arpax17@users.noreply.github.com> Date: Tue, 8 Feb 2022 15:21:05 +0800 Subject: [PATCH 21/21] stop lelong --- .../AuthMobile/LelongMobileController.php | 2 +- app/Http/Controllers/LelongController.php | 16 +++++++++++++++- resources/views/lelong/senarailelong.blade.php | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/AuthMobile/LelongMobileController.php b/app/Http/Controllers/AuthMobile/LelongMobileController.php index 593cc723..6521cae8 100644 --- a/app/Http/Controllers/AuthMobile/LelongMobileController.php +++ b/app/Http/Controllers/AuthMobile/LelongMobileController.php @@ -24,7 +24,7 @@ class LelongMobileController extends Controller $currentdate = $currentdate->toDateString(); // $arrayLelong = []; - $lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get()->toArray(); + $lelong = Lelong::where('tarikh_lelong','=',$currentdate)->where('sts_lelong','=',1)->get()->toArray(); foreach($lelong as $index1=>$lel) { diff --git a/app/Http/Controllers/LelongController.php b/app/Http/Controllers/LelongController.php index eaa4bd7f..f4d15efe 100644 --- a/app/Http/Controllers/LelongController.php +++ b/app/Http/Controllers/LelongController.php @@ -343,7 +343,7 @@ class LelongController extends Controller $lelong = Lelong::where('id','=',$id)->first(); $lelong->masamula_lelong = $currenttime; $lelong->masatamat_lelong = $endtime->toTimeString(); - $lelong->sts_lelong = 1; + $lelong->sts_lelong = 1; //start lelong $lelong->save(); return redirect()->route('lelong.senarailelong') @@ -420,5 +420,19 @@ class LelongController extends Controller ->with('success','Kemaskini Berjaya'); } + public function stop($id) + { + $currentdate = Carbon::now(); + $currenttime = $currentdate->toTimeString(); + + $lelong = Lelong::where('id','=',$id)->first(); + $lelong->masatamat_lelong = $currenttime; + $lelong->sts_lelong = 2; //stop lelong + $lelong->save(); + + return redirect()->route('lelong.senarailelong') + ->with('success','Lelongan berhenti'); + + } } \ No newline at end of file diff --git a/resources/views/lelong/senarailelong.blade.php b/resources/views/lelong/senarailelong.blade.php index ec39972a..18c0dc9d 100644 --- a/resources/views/lelong/senarailelong.blade.php +++ b/resources/views/lelong/senarailelong.blade.php @@ -44,7 +44,7 @@ @elseif ($lel->sts_lelong == 2) @else - + @endif @endhasrole