From 8364635f1913de830cf2649c2ce7a3804c31c34a Mon Sep 17 00:00:00 2001 From: Aji Kamaludin Date: Sun, 4 Jun 2023 12:02:56 +0700 Subject: [PATCH] share web --- TODO.md | 2 +- .../Controllers/Customer/AuthController.php | 4 +- app/Models/Customer.php | 6 + app/Models/SaleItem.php | 29 +++++ public/example.md | 122 +++++++++--------- resources/js/Layouts/Partials/routes.js | 44 +++++-- resources/js/Pages/Home/Cart/VoucherCard.jsx | 2 +- resources/js/Pages/Home/Index/VoucherCard.jsx | 2 +- resources/js/Pages/Home/Profile/Index.jsx | 5 +- resources/js/Pages/Home/Trx/VoucherCard.jsx | 85 ++++++++---- resources/js/Pages/Voucher/Index.jsx | 14 ++ resources/views/app.blade.php | 3 +- 12 files changed, 220 insertions(+), 98 deletions(-) diff --git a/TODO.md b/TODO.md index 059345d..21bf2b6 100644 --- a/TODO.md +++ b/TODO.md @@ -32,7 +32,7 @@ - [x] Customer Deposit Manual - [x] Customer Deposit Payment Gateway - [x] Customer Purchase Voucher -- [ ] Customer Share Buyed Voucher, via WA dll +- [x] Customer Share Buyed Voucher, via WA dll - [ ] Register Refferal - [ ] Customer View Coin History - [ ] Verified Akun diff --git a/app/Http/Controllers/Customer/AuthController.php b/app/Http/Controllers/Customer/AuthController.php index 993785e..abe110e 100644 --- a/app/Http/Controllers/Customer/AuthController.php +++ b/app/Http/Controllers/Customer/AuthController.php @@ -70,7 +70,7 @@ class AuthController extends Controller 'fullname' => $user->name, 'name' => $user->nickname, 'email' => $user->email, - 'username' => Str::slug($user->name.'_'.Str::random(5), '_'), + 'username' => Str::slug($user->name . '_' . Str::random(5), '_'), 'google_id' => $user->id, 'google_oauth_response' => json_encode($user), ]); @@ -118,6 +118,8 @@ class AuthController extends Controller { Auth::logout(); + session()->flush(); + return redirect()->route('customer.login') ->with('message', ['type' => 'success', 'message' => 'you are logged out, see you next time']); } diff --git a/app/Models/Customer.php b/app/Models/Customer.php index d660538..a24d8bc 100644 --- a/app/Models/Customer.php +++ b/app/Models/Customer.php @@ -14,6 +14,12 @@ class Customer extends Authenticatable { use HasFactory, HasUlids, UserTrackable, SoftDeletes; + const NOT_VERIFIED = 0; + + const VERIFIED = 1; + + const IN_VERICATION = 2; + protected $fillable = [ 'username', 'email', diff --git a/app/Models/SaleItem.php b/app/Models/SaleItem.php index 00d3f57..e5362fa 100644 --- a/app/Models/SaleItem.php +++ b/app/Models/SaleItem.php @@ -2,6 +2,8 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Casts\Attribute; + class SaleItem extends Model { protected $fillable = [ @@ -13,6 +15,10 @@ class SaleItem extends Model 'additional_info_json', ]; + protected $appends = [ + 'share_word', + ]; + public function related() { return $this->belongsTo($this->entity_type, 'entity_id'); @@ -22,4 +28,27 @@ class SaleItem extends Model { return $this->belongsTo(Voucher::class, 'entity_id'); } + + public function shareWord(): Attribute + { + return Attribute::make(get: function () { + $string = "Hai, aku baru beli voucher {$this->voucher->location->name} di " . route('home.index'); + $string .= " voucher {$this->voucher->display_quota} buat {$this->voucher->display_expired} + +Username : {$this->voucher->username} +Password : {$this->voucher->password} + +"; + $string .= "Cuman Rp" . number_format($this->price, '0', ',', '.') . " aja, "; + + if ($this->voucher->discount > 0) { + $string .= "lagi ada discount {$this->voucher->discount}% loh. +"; + } + + $string .= "dapatkat penawaran voucher lainnya di " . route('home.index'); + + return $string; + }); + } } diff --git a/public/example.md b/public/example.md index 40a370f..380be94 100644 --- a/public/example.md +++ b/public/example.md @@ -1,64 +1,66 @@ add name="8ga6xmzzkn" password="8ga6xmzzkn" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" add name="8gd5874ncu" password="8gd5874ncu" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax37" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax38" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax39" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax10" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax11" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax12" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax13" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax14" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8ga6xmzzkn1" password="8ga6xmzzkn" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8gd5874ncu2" password="8gd5874ncu" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax373" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax384" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax395" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax106" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax117" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax128" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax139" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8g5t5tax1410" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="YvTdU80eaq" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="IckwYPBq7m" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="25HH4VlPoN" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="Sc5LesGx1S" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="XiMhZXBeyb" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="kaEXtorL8V" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="EfKbqsSuSs" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="3QZJaf5bcJ" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="vPXQF5ZZb3" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="yYKLQFjJll" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="sw7Oi5WznU" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="DYcTEEyZCz" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="m5XTZNFYmq" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="E4k5tXWBsH" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8ky5sMmDUB" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="7Cbm4U52AN" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="Vdkw5NU312" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="NW6GXomQyF" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="SsilG1ZkkM" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="8D8oPBRfhm" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="0GL2GwD9fl" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="Z1f3ZpplaD" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="E1MVCSIvjR" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="1S2xkQ9ofv" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="VdX0x5GjS9" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="xTIRAtrkM4" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="RYvmb03wOD" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="Ji6AEYaJmF" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="yLHQlK79cZ" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="BBvTG8TWv0" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="sMQ4jlCVJB" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="iaQNtPMcQH" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="HsUIUagLX4" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="xUrvtZpRL3" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="Yyh0gjfmQR" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="FHMFQd9MpW" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="pliCYDGkSd" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="nkNvbK2W6e" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="jIGd68CJjM" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -add name="Jm3WDPCNSw" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="OjphpKLOku" password="y82IDN08UG" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="76QcdtVf2n" password="CFx49P6HqS" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="9VVKwtcj92" password="fzIMQtaPqr" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="bd14wEVGZ7" password="Sf8UtEJGV8" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="CHiTtjXtN3" password="99aErwTlC1" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="iWaJ1owXJU" password="AsAGkp2PyH" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="qFSym4Dyvv" password="1C7jm3G1dS" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="m7iaW3KQ1A" password="48AtXcVU8p" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="IfpBUxmw7p" password="njD4egsbBL" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="HJ2OKm1XTw" password="8SbJ6A3t2E" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="mMuU4szzKW" password="5ZzaUe0Ebe" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="SLnsvP6zPH" password="aiRkobrf5h" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="2SsbS08jlF" password="7uSINDupRq" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="4Ar0LM1ori" password="au2b1IpBXO" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="S5ae8SDEcD" password="UBEvoMd0WT" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="Gi6YKgpPce" password="WERgluSveN" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="tNcYsZXANu" password="NioUpFiqAC" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="2v9PbjE1Ea" password="NM3aRgHTWE" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="VoLJxYj8ki" password="jo6KFKyvlL" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="MhX88JDDMn" password="PXwk2fqIqa" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="L5sX3Wry29" password="8fcuD4233c" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="DFwg2fPnD1" password="NJy951jDdn" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="vGfk5OyuqA" password="bBHyVkWdbJ" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="TB8StAN1v7" password="mDYxoLNZWH" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="g0URZDtIyg" password="clvzQMCHWh" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="vWuiC90xFD" password="d0s7f5J9HM" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="fApRI6cRfe" password="25i4n2Wy98" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="fIwt3upUB2" password="nE0k9ts0Ge" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="Uy6m3KeIIu" password="8SYdQI0Xa8" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="FcHWWv7ghH" password="zKRFjZc38B" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="pfzh0qQLDh" password="1NhuC4Td5V" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="TcAJ99FAh0" password="xeoIGE505J" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="wgKRDd2ZR1" password="zrTB3isV3x" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="WaGbcqvvuQ" password="1okKLX1xGi" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="ZXFsLGpAVN" password="Pe7lcrf4LP" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="iJJAKvOpQW" password="O3n51kPTXr" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="gP4PFclDch" password="gaC2qztu9q" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="QjdmmbkUlK" password="lHt7mmUBTk" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="tN18aNfsKd" password="8SUilmynAA" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="zQWgVgPD1Y" password="xqe9X3swf6" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="GmWwMNP5rs" password="IfObJd6YTY" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="px5kb9wfvX" password="IgkQXCL1TT" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="QLo8PfBkjn" password="JjbEkJe3El" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="bldgdSXhEI" password="GOrW9IoMnJ" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="Fr0T5uZ6LO" password="YNwlH6T7fg" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="SeprRn8U6j" password="AKtBiJimvu" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="0FdgdkSmDI" password="xW6wE2mxZ2" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="7oHkJunwDg" password="LUzOKZenCj" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="Akv151n7CU" password="rX0qrug8sS" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="VJATAXwQnX" password="Q8hSSy1UJg" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="BZ5vmW7b57" password="gfblY1wvQS" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="2Rsgk80K3S" password="shrtRorxjI" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="zE8vVLmFfM" password="viAmmxfJgr" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="jKZBmPttp8" password="btUkk6UaVl" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="iE1G8nEE4V" password="QJLCxUHOdW" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="119CZfrYkm" password="jmdrLqs6vn" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="Gwe0uZeQsL" password="OEwu2hAzLD" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="NIP5mcqdbZ" password="OLdE2OxEVi" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="fpE3wq9R2E" password="bdR8lacyq9" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" +add name="6NPANi81Ly" password="2hL28Zr4jr" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176" -foreach(range(1,40) as $r) { -echo 'add name="'. Str::random(10) .'" password="8g5t5tax37" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176"'."\n"; +foreach(range(1,60) as $r) { +echo 'add name="'. Str::random(10) .'" password="'. Str::random(10) .'" profile="NEW-8GB-Kuota-7726-MB" comment="vc-203-06.17.22-a1" limit-bytes-total="8101298176"'."\n"; } diff --git a/resources/js/Layouts/Partials/routes.js b/resources/js/Layouts/Partials/routes.js index 7d24c67..8377ae6 100644 --- a/resources/js/Layouts/Partials/routes.js +++ b/resources/js/Layouts/Partials/routes.js @@ -8,9 +8,11 @@ import { } from 'react-icons/hi' import { HiBanknotes, + HiCheckBadge, + HiCreditCard, HiCurrencyDollar, - HiFaceSmile, HiMap, + HiOutlineCurrencyDollar, HiOutlineGlobeAlt, HiQuestionMarkCircle, HiTicket, @@ -26,14 +28,6 @@ export default [ active: 'dashboard', permission: 'view-dashboard', }, - { - name: 'Deposit', - show: true, - icon: HiCurrencyDollar, - route: route('deposit.index'), - active: 'deposit.*', - permission: 'view-deposit', - }, { name: 'Lokasi', show: true, @@ -50,6 +44,30 @@ export default [ active: 'voucher.*', permission: 'view-voucher', }, + { + name: 'Sale', //TODO + show: true, + icon: HiCreditCard, + route: route('deposit.index'), + active: 'deposit.*', + permission: 'view-deposit', + }, + { + name: 'Deposit', + show: true, + icon: HiCurrencyDollar, + route: route('deposit.index'), + active: 'deposit.*', + permission: 'view-deposit', + }, + { + name: 'Coin Rewards', //TODO + show: true, + icon: HiOutlineCurrencyDollar, + route: route('voucher.index'), + active: 'voucher.*', + permission: 'view-voucher', + }, { name: 'Front Home', show: true, @@ -79,6 +97,14 @@ export default [ show: true, icon: HiUser, items: [ + { + name: 'Verification', //TODO + show: true, + icon: HiCheckBadge, + route: route('customer.index'), + active: 'customer.*', + permission: 'view-customer', + }, { name: 'Customer', show: true, diff --git a/resources/js/Pages/Home/Cart/VoucherCard.jsx b/resources/js/Pages/Home/Cart/VoucherCard.jsx index 48a065e..eafa2d5 100644 --- a/resources/js/Pages/Home/Cart/VoucherCard.jsx +++ b/resources/js/Pages/Home/Cart/VoucherCard.jsx @@ -38,7 +38,7 @@ export default function VoucherCard({ item: { voucher, quantity } }) { )} -
+
{voucher.display_quota}
diff --git a/resources/js/Pages/Home/Index/VoucherCard.jsx b/resources/js/Pages/Home/Index/VoucherCard.jsx index 4e2cf3d..927d410 100644 --- a/resources/js/Pages/Home/Index/VoucherCard.jsx +++ b/resources/js/Pages/Home/Index/VoucherCard.jsx @@ -31,7 +31,7 @@ export default function VoucherCard({ voucher }) {
)}
-
+
{voucher.display_quota}
diff --git a/resources/js/Pages/Home/Profile/Index.jsx b/resources/js/Pages/Home/Profile/Index.jsx index fc74979..3291897 100644 --- a/resources/js/Pages/Home/Profile/Index.jsx +++ b/resources/js/Pages/Home/Profile/Index.jsx @@ -80,7 +80,10 @@ export default function Index({ auth: { user } }) {
Coin
-
+
router.get(route('transactions.index'))} + >
Transaksi
diff --git a/resources/js/Pages/Home/Trx/VoucherCard.jsx b/resources/js/Pages/Home/Trx/VoucherCard.jsx index d9b94ce..1310fa1 100644 --- a/resources/js/Pages/Home/Trx/VoucherCard.jsx +++ b/resources/js/Pages/Home/Trx/VoucherCard.jsx @@ -1,24 +1,38 @@ import { formatIDR } from '@/utils' -import { HiShare } from 'react-icons/hi2' +import { HiClipboardDocumentList, HiShare } from 'react-icons/hi2' +import { toast } from 'react-toastify' + +export default function VoucherCard(props) { + const { + item: { voucher, quantity, share_word }, + } = props + + const handleShare = () => { + console.log(share_word) + if (navigator.canShare) { + navigator.share({ + title: 'Hai Baru beli voucher baru nih', + text: share_word, + }) + return + } + + navigator.clipboard.writeText(share_word) + toast.info('copied to clipboard') + return + } + + const handleCopyToClipboard = (text) => { + toast.info('copied to clipboard') + navigator.clipboard.writeText(text) + } -export default function VoucherCard({ item: { voucher, quantity } }) { return ( -
-
+
+
{voucher.location.name}
-
{ - navigator.share({ - title: 'Hello World', - text: 'Hai Hai', - }) - }} - > - -
@@ -40,7 +54,7 @@ export default function VoucherCard({ item: { voucher, quantity } }) {
)}
-
+
{voucher.display_quota}
@@ -57,17 +71,42 @@ export default function VoucherCard({ item: { voucher, quantity } }) {
{formatIDR(+voucher.price * +quantity)}
-
-
- Username :{' '} - {voucher.username} +
+
+
Username :
+
{voucher.username}
+
+ handleCopyToClipboard(voucher.username) + } + > + +
-
- Password :{' '} - {voucher.password} +
+
Password :
+
{voucher.password}
+
+ handleCopyToClipboard(voucher.password) + } + > + +
+
+
handleShare()} + > + +
Share
+
+
) } diff --git a/resources/js/Pages/Voucher/Index.jsx b/resources/js/Pages/Voucher/Index.jsx index 394d5f8..2a89a0c 100644 --- a/resources/js/Pages/Voucher/Index.jsx +++ b/resources/js/Pages/Voucher/Index.jsx @@ -132,6 +132,12 @@ export default function Index(props) { > Kuota + + Terjual + {voucher.display_quota} + + {+voucher.is_sold === 1 + ? 'Ya' + : 'Tidak'} + + - {{ config('app.name', 'Laravel') }} + {{ config('app.name', 'Voucher') }}