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(
|
StorePushNotification::dispatch(
|
||||||
PushNotification::whereIn('user_id', $userIds)->get(),
|
PushNotification::whereIn('user_id', $userIds)->get(),
|
||||||
[
|
[
|
||||||
'title' => 'Member Baru',
|
'title' => '🎉Member Baru Bergabung!',
|
||||||
'body' => 'Seorang member baru baru saja bergabung. Cek selengkapnya di aplikasi',
|
'body' => 'Ada member baru saja. Yuk lihat profil lengkapnya di aplikasi! 🌟',
|
||||||
'url' => route('studio.loyalty.customer.index'),
|
'url' => route('studio.loyalty.customer.index'),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@ -99,7 +99,7 @@ public function auth()
|
|||||||
$maxUser = User::max('id') + 1;
|
$maxUser = User::max('id') + 1;
|
||||||
$referralCode = ReferralCode::where('code', $this->referral_code)->first();
|
$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([
|
$user = User::create([
|
||||||
'email' => $this->email,
|
'email' => $this->email,
|
||||||
'username' => $this->username,
|
'username' => $this->username,
|
||||||
@ -107,7 +107,7 @@ public function auth()
|
|||||||
'status' => UserStatus::ACTIVE,
|
'status' => UserStatus::ACTIVE,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Customer::create([
|
$customer = Customer::create([
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
'phone_number' => $this->phone_number,
|
'phone_number' => $this->phone_number,
|
||||||
@ -148,5 +148,7 @@ public function auth()
|
|||||||
|
|
||||||
$user->sendEmailVerificationNotification();
|
$user->sendEmailVerificationNotification();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return $customer->name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,16 +79,15 @@ public function store()
|
|||||||
$payroll->save();
|
$payroll->save();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if ($adjustment->type->value == SalaryAdjustmentType::BONUS->value) {
|
||||||
if ($adjustment->type == SalaryAdjustmentType::BONUS->value) {
|
|
||||||
return [
|
return [
|
||||||
'userIds' => $this->user_ids,
|
'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 [
|
return [
|
||||||
'userIds' => $this->user_ids,
|
'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');
|
$this->uploadMedia($this->thumbnail, $article, 'thumbnail');
|
||||||
});
|
});
|
||||||
|
|
||||||
return $article;
|
return $article->title;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update()
|
public function update()
|
||||||
|
|||||||
@ -47,8 +47,8 @@ public function save()
|
|||||||
StorePushNotification::dispatch(
|
StorePushNotification::dispatch(
|
||||||
PushNotification::all(),
|
PushNotification::all(),
|
||||||
[
|
[
|
||||||
'title' => 'Parfum',
|
'title' => '✨ Aroma Baru!',
|
||||||
'body' => 'Ada yang baru nih! Aroma terbaru sudah siap kamu coba. Yuk intip dulu sebelum kehabisan.',
|
'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(
|
StorePushNotification::dispatch(
|
||||||
PushNotification::all(),
|
PushNotification::all(),
|
||||||
[
|
[
|
||||||
'title' => 'Voucher',
|
'title' => '🎁 Voucher Baru!',
|
||||||
'body' => 'Ada voucher baru untuk kamu! Jangan sampai kelewatan, yuk cek sekarang dan nikmati penawarannya.',
|
'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\WithAuthorization;
|
||||||
use App\Traits\WithToast;
|
use App\Traits\WithToast;
|
||||||
use App\Traits\WithUpdatedData;
|
use App\Traits\WithUpdatedData;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use Livewire\Attributes\Title;
|
use Livewire\Attributes\Title;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
@ -27,8 +28,8 @@ public function save()
|
|||||||
StorePushNotification::dispatch(
|
StorePushNotification::dispatch(
|
||||||
PushNotification::all(),
|
PushNotification::all(),
|
||||||
[
|
[
|
||||||
'title' => 'Artikel',
|
'title' => '📝 Artikel Baru!',
|
||||||
'body' => $result->title,
|
'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();
|
$userIds = User::role(['Developer', 'Owner', 'Leader'])->pluck('id')->toArray();
|
||||||
|
|
||||||
StorePushNotification::dispatch(
|
StorePushNotification::dispatch(
|
||||||
PushNotification::whereIn('user_id', $userIds)->get(),
|
PushNotification::whereIn('user_id', $userIds)->get(),
|
||||||
[
|
[
|
||||||
'title' => 'Order',
|
'title' => '🛒 Order Baru!',
|
||||||
'body' => 'Ada order baru masuk dengan nominal '.currency($result['data']['total'], 'Rp'),
|
'body' => 'Ada order baru masuk dengan nominal '.currency($result['data']['total'], 'Rp').' ✨',
|
||||||
'url' => route('studio.manage.order.index'),
|
'url' => route('studio.manage.order.index'),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user