refactor(push notification): merubah style message nya supaya lebih friendly dan menarik
This commit is contained in:
parent
fb5e85d3c4
commit
dd70c72c92
@ -87,8 +87,8 @@ public function register()
|
||||
StorePushNotification::dispatch(
|
||||
PushNotification::whereIn('user_id', $userIds)->get(),
|
||||
[
|
||||
'title' => 'Member Baru',
|
||||
'body' => 'Seorang member baru baru saja bergabung. Cek selengkapnya di aplikasi',
|
||||
'title' => '🎉Member Baru Bergabung!',
|
||||
'body' => 'Ada member baru saja. Yuk lihat profil lengkapnya di aplikasi! 🌟',
|
||||
'url' => route('studio.loyalty.customer.index'),
|
||||
],
|
||||
);
|
||||
|
||||
@ -99,7 +99,7 @@ public function auth()
|
||||
$maxUser = User::max('id') + 1;
|
||||
$referralCode = ReferralCode::where('code', $this->referral_code)->first();
|
||||
|
||||
DB::transaction(function () use ($tier, $maxUser, $referralCode) {
|
||||
DB::transaction(function () use ($tier, $maxUser, $referralCode, &$customer) {
|
||||
$user = User::create([
|
||||
'email' => $this->email,
|
||||
'username' => $this->username,
|
||||
@ -107,7 +107,7 @@ public function auth()
|
||||
'status' => UserStatus::ACTIVE,
|
||||
]);
|
||||
|
||||
Customer::create([
|
||||
$customer = Customer::create([
|
||||
'user_id' => $user->id,
|
||||
'name' => $this->name,
|
||||
'phone_number' => $this->phone_number,
|
||||
@ -148,5 +148,7 @@ public function auth()
|
||||
|
||||
$user->sendEmailVerificationNotification();
|
||||
});
|
||||
|
||||
return $customer->name;
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,16 +79,15 @@ public function store()
|
||||
$payroll->save();
|
||||
}
|
||||
});
|
||||
|
||||
if ($adjustment->type == SalaryAdjustmentType::BONUS->value) {
|
||||
if ($adjustment->type->value == SalaryAdjustmentType::BONUS->value) {
|
||||
return [
|
||||
'userIds' => $this->user_ids,
|
||||
'message' => 'Horee, Anda mendapatkan bonus sebesar '.currency($amount, 'Rp').' untuk bulan ini, Lihat detailnya di menu Penggajian.',
|
||||
'message' => '🎉 Horee! Anda mendapatkan bonus sebesar '.currency($amount, 'Rp').' untuk bulan ini. Lihat detailnya di menu Penggajian! 💰✨',
|
||||
];
|
||||
} elseif ($adjustment->type == SalaryAdjustmentType::DEDUCTION->value) {
|
||||
} elseif ($adjustment->type->value == SalaryAdjustmentType::DEDUCTION->value) {
|
||||
return [
|
||||
'userIds' => $this->user_ids,
|
||||
'message' => 'Yahh, gaji Anda dipotong sebesar '.currency($amount, 'Rp').' untuk bulan ini, Lihat detailnya di menu Penggajian.',
|
||||
'message' => '⚠️ Yahh, gaji Anda dipotong sebesar '.currency($amount, 'Rp').' untuk bulan ini. Lihat detailnya di menu Penggajian. 📄',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ public function store()
|
||||
$this->uploadMedia($this->thumbnail, $article, 'thumbnail');
|
||||
});
|
||||
|
||||
return $article;
|
||||
return $article->title;
|
||||
}
|
||||
|
||||
public function update()
|
||||
|
||||
@ -47,8 +47,8 @@ public function save()
|
||||
StorePushNotification::dispatch(
|
||||
PushNotification::all(),
|
||||
[
|
||||
'title' => 'Parfum',
|
||||
'body' => 'Ada yang baru nih! Aroma terbaru sudah siap kamu coba. Yuk intip dulu sebelum kehabisan.',
|
||||
'title' => '✨ Aroma Baru!',
|
||||
'body' => 'Ada yang baru nih! Aroma terbaru sudah siap kamu coba. Yuk cobain dulu sebelum kehabisan! 🌸✨',
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@ -36,8 +36,8 @@ public function save()
|
||||
StorePushNotification::dispatch(
|
||||
PushNotification::all(),
|
||||
[
|
||||
'title' => 'Voucher',
|
||||
'body' => 'Ada voucher baru untuk kamu! Jangan sampai kelewatan, yuk cek sekarang dan nikmati penawarannya.',
|
||||
'title' => '🎁 Voucher Baru!',
|
||||
'body' => 'Ada voucher baru untuk kamu! Jangan sampai kelewatan, yuk cek sekarang dan nikmati penawarannya ✨🎉',
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
use App\Traits\WithAuthorization;
|
||||
use App\Traits\WithToast;
|
||||
use App\Traits\WithUpdatedData;
|
||||
use Illuminate\Support\Str;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Component;
|
||||
|
||||
@ -27,8 +28,8 @@ public function save()
|
||||
StorePushNotification::dispatch(
|
||||
PushNotification::all(),
|
||||
[
|
||||
'title' => 'Artikel',
|
||||
'body' => $result->title,
|
||||
'title' => '📝 Artikel Baru!',
|
||||
'body' => Str::limit($result, 50).' '.' ✨ Yuk baca selengkapnya di aplikasi!',
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@ -91,12 +91,11 @@ public function save()
|
||||
}
|
||||
|
||||
$userIds = User::role(['Developer', 'Owner', 'Leader'])->pluck('id')->toArray();
|
||||
|
||||
StorePushNotification::dispatch(
|
||||
PushNotification::whereIn('user_id', $userIds)->get(),
|
||||
[
|
||||
'title' => 'Order',
|
||||
'body' => 'Ada order baru masuk dengan nominal '.currency($result['data']['total'], 'Rp'),
|
||||
'title' => '🛒 Order Baru!',
|
||||
'body' => 'Ada order baru masuk dengan nominal '.currency($result['data']['total'], 'Rp').' ✨',
|
||||
'url' => route('studio.manage.order.index'),
|
||||
],
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user