refactor: replace direct message retrieval with key-based retrieval in CheerfulNotification across various enums and Filament pages for improved localization and maintainability

This commit is contained in:
Yoga Pangestu 2026-04-06 09:22:07 +07:00
parent f485b2cef3
commit 3a5ef20334
87 changed files with 1900 additions and 400 deletions

View File

@ -19,9 +19,9 @@ enum ApprovalStatus: int implements HasColor, HasLabel
public function getLabel(): ?string
{
return match ($this) {
self::PENDING => CheerfulNotification::getMessage('Menunggu Persetujuan ⏳✨', 'Menunggu'),
self::ACCEPTED => CheerfulNotification::getMessage('Diterima! ✅🚀', 'Menerima'),
self::REJECTED => CheerfulNotification::getMessage('Ditolak, Tetap Semangat! 🛑😔', 'Menolak'),
self::PENDING => CheerfulNotification::getByKey('enum.approval_status.pending'),
self::ACCEPTED => CheerfulNotification::getByKey('enum.approval_status.accepted'),
self::REJECTED => CheerfulNotification::getByKey('enum.approval_status.rejected'),
};
}

View File

@ -21,11 +21,11 @@ enum CooperationStatus: int implements HasColor, HasLabel
public function getLabel(): ?string
{
return match ($this) {
self::PENDING => CheerfulNotification::getMessage('Menunggu... Tetap Sabar Ya! ⏳✨', 'Menunggu'),
self::ASSIGNMENT => CheerfulNotification::getMessage('Sedang Ditugaskan nih! 📋🛠️', 'Penugasan'),
self::VERIFICATION => CheerfulNotification::getMessage('Lagi Diverifikasi, Tunggu Sebentar! 🔍✅', 'Verifikasi'),
self::PAYMENT => CheerfulNotification::getMessage('Waktunya Pembayaran! 💵🚀', 'Pembayaran'),
self::COMPLETED => CheerfulNotification::getMessage('Selesai! Mantap Jiwa! 🎉🔥', 'Selesai'),
self::PENDING => CheerfulNotification::getByKey('enum.cooperation_status.pending'),
self::ASSIGNMENT => CheerfulNotification::getByKey('enum.cooperation_status.assignment'),
self::VERIFICATION => CheerfulNotification::getByKey('enum.cooperation_status.verification'),
self::PAYMENT => CheerfulNotification::getByKey('enum.cooperation_status.payment'),
self::COMPLETED => CheerfulNotification::getByKey('enum.cooperation_status.completed'),
};
}

View File

@ -18,8 +18,8 @@ enum DataChangeDecision: int implements HasColor, HasLabel
public function getLabel(): ?string
{
return match ($this) {
self::APPROVED => CheerfulNotification::getMessage('Perubahan Disetujui! ✅🚀', 'Disetujui'),
self::REJECTED => CheerfulNotification::getMessage('Perubahan Ditolak 🛑😔', 'Ditolak'),
self::APPROVED => CheerfulNotification::getByKey('enum.data_change_decision.approved'),
self::REJECTED => CheerfulNotification::getByKey('enum.data_change_decision.rejected'),
};
}

View File

@ -19,9 +19,9 @@ enum DataChangeStatus: int implements HasColor, HasLabel
public function getLabel(): ?string
{
return match ($this) {
self::PENDING => CheerfulNotification::getMessage('Menunggu Verifikasi ⏳✨', 'Menunggu Verifikasi'),
self::APPROVED => CheerfulNotification::getMessage('Perubahan Disetujui! ✅🚀', 'Disetujui'),
self::REJECTED => CheerfulNotification::getMessage('Perubahan Ditolak 🛑😔', 'Ditolak'),
self::PENDING => CheerfulNotification::getByKey('enum.data_change_status.pending'),
self::APPROVED => CheerfulNotification::getByKey('enum.data_change_status.approved'),
self::REJECTED => CheerfulNotification::getByKey('enum.data_change_status.rejected'),
};
}

View File

@ -19,9 +19,9 @@ enum DecisionAdmin: int implements HasColor, HasLabel
public function getLabel(): ?string
{
return match ($this) {
self::APPROVED => CheerfulNotification::getMessage('Sudah Disetujui! ✅🚀', 'Disetujui'),
self::NEED_REVISION => CheerfulNotification::getMessage('Perlu Revisi nih! ✍️🛠️', 'Perlu Revisi'),
self::REJECTED => CheerfulNotification::getMessage('Ditolak, Tetap Semangat! 🛑😔', 'Ditolak'),
self::APPROVED => CheerfulNotification::getByKey('enum.decision_admin.approved'),
self::NEED_REVISION => CheerfulNotification::getByKey('enum.decision_admin.need_revision'),
self::REJECTED => CheerfulNotification::getByKey('enum.decision_admin.rejected'),
};
}

View File

@ -18,9 +18,9 @@ enum NewsStatus: int implements HasLabel
public function getLabel(): ?string
{
return match ($this) {
self::DRAFT => CheerfulNotification::getMessage('Draft - Sempurnakan Lagi! ✍️🛠️', 'Draft'),
self::PUBLISHED => CheerfulNotification::getMessage('Telah Tayang! 🚀✨', 'Publish'),
self::ARCHIVED => CheerfulNotification::getMessage('Arsip - Disimpan Dulu Ya! 📦🔒', 'Arsip'),
self::DRAFT => CheerfulNotification::getByKey('enum.news_status.draft'),
self::PUBLISHED => CheerfulNotification::getByKey('enum.news_status.published'),
self::ARCHIVED => CheerfulNotification::getByKey('enum.news_status.archived'),
};
}

View File

@ -20,10 +20,10 @@ enum VerificationStatus: int implements HasColor, HasLabel
public function getLabel(): ?string
{
return match ($this) {
self::PENDING => CheerfulNotification::getMessage('Menunggu Verifikasi ⏳✨', 'Menunggu Verifikasi'),
self::APPROVED => CheerfulNotification::getMessage('Sudah Disetujui! ✅🚀', 'Disetujui'),
self::NEED_REVISION => CheerfulNotification::getMessage('Perlu Revisi nih! ✍️🛠️', 'Perlu Revisi'),
self::REJECTED => CheerfulNotification::getMessage('Ditolak, Tetap Semangat! 🛑😔', 'Ditolak'),
self::PENDING => CheerfulNotification::getByKey('enum.verification_status.pending'),
self::APPROVED => CheerfulNotification::getByKey('enum.verification_status.approved'),
self::NEED_REVISION => CheerfulNotification::getByKey('enum.verification_status.need_revision'),
self::REJECTED => CheerfulNotification::getByKey('enum.verification_status.rejected'),
};
}

View File

@ -11,9 +11,9 @@ protected function setUp(): void
{
parent::setUp();
$this->modalHeading(fn () => CheerfulNotification::getMessage('Tambah Data Seru! 🚀✨', 'Tambah Data Baru'));
$this->modalHeading(fn () => CheerfulNotification::getByKey('actions.create.title'));
$this->modalDescription(fn () => CheerfulNotification::getMessage('Isi form di bawah ini dengan semangat ya, biar datanya tersimpan dengan aman! 💪😊', 'Silakan isi formulir di bawah ini dengan lengkap untuk menambahkan data baru.'));
$this->modalDescription(fn () => CheerfulNotification::getByKey('actions.create.description'));
$this->successNotification(fn () => CheerfulNotification::create()
);

View File

@ -11,9 +11,9 @@ protected function setUp(): void
{
parent::setUp();
$this->modalHeading(fn () => CheerfulNotification::getMessage('Sempurnakan Datanya 📝✨', 'Ubah Data'));
$this->modalHeading(fn () => CheerfulNotification::getByKey('actions.edit.title'));
$this->modalDescription(fn () => CheerfulNotification::getMessage('Ayo kita perbarui supaya datanya makin akurat dan segar lagi! 🛠️👌', 'Silakan perbarui informasi pada formulir di bawah ini.'));
$this->modalDescription(fn () => CheerfulNotification::getByKey('actions.edit.description'));
$this->successNotification(fn () => CheerfulNotification::update()
);

View File

@ -11,9 +11,9 @@ protected function setUp(): void
{
parent::setUp();
$this->modalHeading(fn () => CheerfulNotification::getMessage('Panggil Balik Datanya? ♻️✨', 'Pulihkan Data'));
$this->modalHeading(fn () => CheerfulNotification::getByKey('actions.restore.title'));
$this->modalDescription(fn () => CheerfulNotification::getMessage('Siap buat mengaktifkan kembali data yang sempat hilang? Yuk, kita pulihkan bareng-bareng! 😉🙌', 'Apakah Anda yakin ingin memulihkan data yang telah dihapus ini?'));
$this->modalDescription(fn () => CheerfulNotification::getByKey('actions.restore.description'));
$this->successNotification(fn () => CheerfulNotification::restore()
);

View File

@ -13,19 +13,19 @@ public static function make(string $entity): array
{
return [
DeleteBulkAction::make()
->modalHeading(fn () => CheerfulNotification::getMessage("Mau Hapus Banyak {$entity}? 🗑️🤔", "Hapus Data {$entity} Terpilih"))
->modalHeading(fn () => CheerfulNotification::getByKey('actions.bulk.delete', ['entity' => $entity]))
->successNotification(
CheerfulNotification::bulkDelete()
),
ForceDeleteBulkAction::make()
->modalHeading(fn () => CheerfulNotification::getMessage("Hapus Permanen {$entity} Terpilih? 🗑️🔥", "Hapus Permanen Data {$entity} Terpilih"))
->modalHeading(fn () => CheerfulNotification::getByKey('actions.bulk.force_delete', ['entity' => $entity]))
->successNotification(
CheerfulNotification::bulkForceDelete()
),
RestoreBulkAction::make()
->modalHeading(fn () => CheerfulNotification::getMessage("Pulihkan {$entity} yang Dipilih? ♻️✨", "Pulihkan Data {$entity} Terpilih"))
->modalHeading(fn () => CheerfulNotification::getByKey('actions.bulk.restore', ['entity' => $entity]))
->successNotification(
CheerfulNotification::bulkRestore()
),

View File

@ -25,8 +25,8 @@ protected function setUp(): void
->icon('heroicon-o-check')
->size('sm')
->requiresConfirmation()
->modalHeading(fn () => CheerfulNotification::getMessage('Setujui Verifikasi? ✅✨', 'Setujui Verifikasi'))
->modalDescription(fn () => CheerfulNotification::getMessage('Yakin datanya sudah oke semua? Yuk, kita resmikan verifikasinya sekarang! 🚀😊', 'Apakah Anda yakin ingin menyetujui verifikasi ini? Seluruh data yang diajukan akan dianggap valid.'))
->modalHeading(fn () => CheerfulNotification::getByKey('actions.approve.title'))
->modalDescription(fn () => CheerfulNotification::getByKey('actions.approve.description'))
->modalSubmitActionLabel('Ya, Setujui')
->action(function (array $arguments): void {
$this->processReview($arguments['id'], DecisionAdmin::APPROVED, null);

View File

@ -21,8 +21,8 @@ protected function processReview(int $requestId, DecisionAdmin $decision, ?strin
if (! $verificationRequest) {
CheerfulNotification::danger(
CheerfulNotification::getMessage('Belum ketemu nih 🙌', 'Data Tidak Ditemukan'),
CheerfulNotification::getMessage('Data verifikasi belum kami temukan. Coba sebentar lagi, ya.', 'Permintaan verifikasi tidak ditemukan dalam sistem kami.')
CheerfulNotification::getByKey('verification.admin.process.not_found.title'),
CheerfulNotification::getByKey('verification.admin.process.not_found.body')
)
->send();
@ -60,8 +60,8 @@ protected function processReview(int $requestId, DecisionAdmin $decision, ?strin
};
CheerfulNotification::success(
CheerfulNotification::getMessage('Berhasil Diproses! ✨', 'Berhasil Diproses'),
CheerfulNotification::getMessage("Mantap! Verifikasi telah {$actionLabel} dan notifikasi sudah dikirim ke pengguna. Kerja bagus, Admin! 💪", "Proses verifikasi telah {$actionLabel} dan notifikasi telah dikirimkan ke pihak pengguna.")
CheerfulNotification::getByKey('verification.admin.process.success.title'),
CheerfulNotification::getByKey('verification.admin.process.success.body', ['action' => $actionLabel])
)
->send();
@ -69,19 +69,19 @@ protected function processReview(int $requestId, DecisionAdmin $decision, ?strin
$partnerUser = $verificationRequest->company?->user;
if ($partnerUser) {
$statusTitle = match ($decision) {
DecisionAdmin::APPROVED => CheerfulNotification::getMessage('Horee! Verifikasi Disetujui 🎉', 'Verifikasi Disetujui'),
DecisionAdmin::NEED_REVISION => CheerfulNotification::getMessage('Yah, Ada Yang Perlu Direvisi nih 📝', 'Perlu Revisi Verifikasi'),
DecisionAdmin::REJECTED => CheerfulNotification::getMessage('Maaf, Verifikasi Ditolak 😔', 'Verifikasi Ditolak'),
DecisionAdmin::APPROVED => CheerfulNotification::getByKey('verification.admin.notif_user.approved.title'),
DecisionAdmin::NEED_REVISION => CheerfulNotification::getByKey('verification.admin.notif_user.revision.title'),
DecisionAdmin::REJECTED => CheerfulNotification::getByKey('verification.admin.notif_user.rejected.title'),
};
$body = match ($decision) {
DecisionAdmin::APPROVED => CheerfulNotification::getMessage('Yeay! Pengajuan verifikasi perusahaan Anda telah disetujui. Sekarang Anda sudah resmi terverifikasi dan bekerja sama dengan kami! 🎊', 'Pengajuan verifikasi perusahaan Anda telah disetujui.'),
DecisionAdmin::NEED_REVISION => CheerfulNotification::getMessage('Ayo sedikit lagi! Admin meminta beberapa perbaikan pada pengajuan Anda agar bisa segera disetujui. 💪', 'Admin meminta beberapa perbaikan pada pengajuan verifikasi Anda.'),
DecisionAdmin::REJECTED => CheerfulNotification::getMessage('Yah, maaf banget... pengajuan verifikasi perusahaan Anda belum bisa kami terima saat ini. 💔', 'Pengajuan verifikasi perusahaan Anda tidak dapat kami setujui saat ini.'),
DecisionAdmin::APPROVED => CheerfulNotification::getByKey('verification.admin.notif_user.approved.body'),
DecisionAdmin::NEED_REVISION => CheerfulNotification::getByKey('verification.admin.notif_user.revision.body'),
DecisionAdmin::REJECTED => CheerfulNotification::getByKey('verification.admin.notif_user.rejected.body'),
};
if ($note) {
$body .= "\n\n".CheerfulNotification::getMessage("Catatan Admin: {$note} 😊", "Catatan Admin: {$note}");
$body .= "\n\n".CheerfulNotification::getByKey('verification.admin.notif_user.note', ['note' => $note]);
}
$partnerUser->notify(new BroadcastNotification([
@ -104,8 +104,8 @@ protected function processReview(int $requestId, DecisionAdmin $decision, ?strin
]);
CheerfulNotification::danger(
CheerfulNotification::getMessage('Terjadi Kesalahan ⚠️', 'Terjadi Kesalahan Sistem'),
CheerfulNotification::getMessage('Proses verifikasi gagal karena kesalahan sistem. Tim kami sudah mencatat masalah ini. Silakan coba lagi nanti.', 'Proses verifikasi gagal dilakukan karena kendala teknis. Silakan laporkan jika masalah berlanjut.')
CheerfulNotification::getByKey('verification.admin.process.error.title'),
CheerfulNotification::getByKey('verification.admin.process.error.body')
)
->send();
}

View File

@ -26,8 +26,8 @@ protected function setUp(): void
->icon('heroicon-o-x-mark')
->size('sm')
->requiresConfirmation()
->modalHeading(fn () => CheerfulNotification::getMessage('Tolak Verifikasi? 🛑🤔', 'Tolak Verifikasi'))
->modalDescription(fn () => CheerfulNotification::getMessage('Yakin mau ditolak secara permanen? Pastikan alasannya sudah sreg di hati ya! 😔📝', 'Apakah Anda yakin ingin menolak verifikasi ini secara permanen?'))
->modalHeading(fn () => CheerfulNotification::getByKey('actions.reject.title'))
->modalDescription(fn () => CheerfulNotification::getByKey('actions.reject.description'))
->modalSubmitActionLabel('Ya, Tolak')
->schema([
Textarea::make('note')

View File

@ -26,8 +26,8 @@ protected function setUp(): void
->color('warning')
->icon('heroicon-o-pencil-square')
->size('sm')
->modalHeading(fn () => CheerfulNotification::getMessage('Minta Revisi Data 📝⚠️', 'Minta Revisi Data'))
->modalDescription(fn () => CheerfulNotification::getMessage('Siap kirim instruksi perbaikan? Kasih catatan yang jelas ya biar pengguna nggak bingung! 😊', 'Silakan masukkan instruksi perbaikan yang diperlukan untuk pengguna.'))
->modalHeading(fn () => CheerfulNotification::getByKey('actions.revision.title'))
->modalDescription(fn () => CheerfulNotification::getByKey('actions.revision.description'))
->schema([
Textarea::make('note')
->label('Catatan Revisi')

View File

@ -158,10 +158,10 @@ public function verifications(): LengthAwarePaginator
]),
],
'messages' => [
'detail' => CheerfulNotification::getMessage('Detail Data 🔍✨', 'Detail'),
'revision' => CheerfulNotification::getMessage('Sabar ya, pengguna lagi sibuk revisi data nih! ⏳✍️', 'Menunggu revisi dari pengguna...'),
'approved' => CheerfulNotification::getMessage('Yeay! Verifikasi sudah beres dan disetujui! ✅🚀', 'Verifikasi selesai'),
'rejected' => CheerfulNotification::getMessage('Yah, pengajuannya terpaksa belum bisa diterima. 🛑😔', 'Pengajuan ditolak'),
'detail' => CheerfulNotification::getByKey('verification.admin.messages.detail'),
'revision' => CheerfulNotification::getByKey('verification.admin.messages.revision'),
'approved' => CheerfulNotification::getByKey('verification.admin.messages.approved'),
'rejected' => CheerfulNotification::getByKey('verification.admin.messages.rejected'),
],
];
});
@ -246,11 +246,11 @@ public function rejectAction(): Action
public function getEmptyStateHeading(): string
{
return CheerfulNotification::getMessage('Belum ada pengajuan verifikasi nih! 📭✨', 'Tidak ada pengajuan verifikasi');
return CheerfulNotification::getByKey('verification.admin.empty_state.heading');
}
public function getEmptyStateDescription(): string
{
return CheerfulNotification::getMessage('Tenang saja, mungkin sebentar lagi bakal ada yang kirim pengajuan verifikasi. Ditunggu saja ya! 😊⏳', 'Belum ada pengajuan verifikasi dari user.');
return CheerfulNotification::getByKey('verification.admin.empty_state.description');
}
}

View File

@ -34,8 +34,8 @@ public function resendNotificationAction(): Action
$this->sendEmailVerificationNotification($this->getVerifiable());
CheerfulNotification::success(
CheerfulNotification::getMessage('Mail Meluncur! 📧🚀', 'Email Terkirim'),
CheerfulNotification::getMessage('Tautan verifikasi baru sudah dikirim ke alamat surelmu. Cek inbox (atau spam) ya! 😉✨', 'Tautan verifikasi baru telah dikirimkan ke alamat email Anda. Silakan periksa kotak masuk atau spam.')
CheerfulNotification::getByKey('auth.email_verification.resend_success.title'),
CheerfulNotification::getByKey('auth.email_verification.resend_success.body')
)->send();
});
}
@ -43,8 +43,8 @@ public function resendNotificationAction(): Action
protected function getRateLimitedNotification(TooManyRequestsException $exception): ?Notification
{
return CheerfulNotification::danger(
CheerfulNotification::getMessage('Pelan-pelan ya ⏳', 'Terlalu Banyak Permintaan'),
CheerfulNotification::getMessage('Permintaan terlalu sering. Tunggu sebentar lalu coba lagi dalam '.$exception->secondsUntilAvailable.' detik.', 'Anda telah melakukan terlalu banyak permintaan. Silakan coba kembali dalam '.$exception->secondsUntilAvailable.' detik.')
CheerfulNotification::getByKey('auth.email_verification.rate_limited.title'),
CheerfulNotification::getByKey('auth.email_verification.rate_limited.body', ['seconds' => $exception->secondsUntilAvailable])
)->send();
}
}

View File

@ -103,8 +103,8 @@ public function authenticate(): ?LoginResponse
if ($user instanceof FilamentUser && (! $user->canAccessPanel(Filament::getCurrentOrDefaultPanel()))) {
CheerfulNotification::danger(
CheerfulNotification::getMessage('Akun Tidak Aktif 🚫', 'Akses Ditolak'),
CheerfulNotification::getMessage('Maaf, akun Anda saat ini tidak aktif. Silakan hubungi Administrator. 📞', 'Akun Anda saat ini tidak memiliki izin untuk mengakses sistem. Silakan hubungi administrator.')
CheerfulNotification::getByKey('auth.login.inactive.title'),
CheerfulNotification::getByKey('auth.login.inactive.body')
)->send();
throw ValidationException::withMessages([]);
@ -151,8 +151,8 @@ public function authenticate(): ?LoginResponse
session()->regenerate();
CheerfulNotification::success(
CheerfulNotification::getMessage('Hore! Berhasil Masuk 🎉', 'Login Berhasil'),
CheerfulNotification::getMessage('Selamat datang kembali, '.$user->name.'! Siap untuk beraksi hari ini? 🚀✨', 'Selamat datang kembali, '.$user->name.'. Anda telah berhasil masuk ke dalam sistem.')
CheerfulNotification::getByKey('auth.login.success.title'),
CheerfulNotification::getByKey('auth.login.success.body', ['name' => $user->name])
)->send();
return app(LoginResponse::class);
@ -161,8 +161,8 @@ public function authenticate(): ?LoginResponse
protected function throwFailureValidationException(): never
{
CheerfulNotification::danger(
CheerfulNotification::getMessage('Ups! Gagal Masuk 😅', 'Login Gagal'),
CheerfulNotification::getMessage('Sepertinya ada yang salah nih. Coba cek email atau kata sandi mu lagi ya! 🤔🔐', 'Kredensial yang Anda masukkan salah. Silakan periksa kembali email dan kata sandi Anda.')
CheerfulNotification::getByKey('auth.login.failed.title'),
CheerfulNotification::getByKey('auth.login.failed.body')
)->send();
throw ValidationException::withMessages([]);

View File

@ -90,8 +90,8 @@ public function form(Schema $schema): Schema
{
return $schema
->components([
Section::make(CheerfulNotification::getMessage('Detail Profil 👤✨', 'Profil Pengguna'))
->description(CheerfulNotification::getMessage('Yuk, kelola informasi detail profil Anda agar selalu terkini! 👤🚀', 'Kelola informasi profil dasar Anda di bawah ini.'))
Section::make(CheerfulNotification::getByKey('profile.detail.title'))
->description(CheerfulNotification::getByKey('profile.detail.description'))
->icon(CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-user' : null)
->schema([
Grid::make(2)
@ -127,8 +127,8 @@ public function form(Schema $schema): Schema
]),
]),
Section::make(CheerfulNotification::getMessage('Pengaturan Tampilan & UX 🎨✨', 'Preferensi Tampilan'))
->description(CheerfulNotification::getMessage('Personalisasi pengalaman aplikasi Anda agar lebih nyaman dan sesuai selera! 🌈🚀', 'Sesuaikan gaya bahasa, warna tema, dan jenis huruf aplikasi Anda.'))
Section::make(CheerfulNotification::getByKey('profile.ux.title'))
->description(CheerfulNotification::getByKey('profile.ux.description'))
->icon(CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-swatch' : null)
->schema([
Grid::make(2)
@ -197,8 +197,8 @@ public function form(Schema $schema): Schema
]),
]),
Section::make(CheerfulNotification::getMessage('Keamanan Akun 🔐✨', 'Ubah Kata Sandi'))
->description(CheerfulNotification::getMessage('Ingin ganti kata sandi? Pastikan pilih yang kuat ya biar makin aman! 🔐💪', 'Silakan masukkan kata sandi baru untuk memperbarui keamanan akun Anda.'))
Section::make(CheerfulNotification::getByKey('profile.security.title'))
->description(CheerfulNotification::getByKey('profile.security.description'))
->icon(CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-lock-closed' : null)
->schema([
Grid::make(2)
@ -247,8 +247,8 @@ protected function handleRecordUpdate(Model $record, array $data): Model
protected function afterSave(): void
{
CheerfulNotification::success(
CheerfulNotification::getMessage('Profil Diperbarui! ✨', 'Profil Diperbarui'),
CheerfulNotification::getMessage('Sip! Detail profil baru Anda sudah tersimpan dengan aman. Terus semangat ya! 💪😊', 'Perubahan pada profil Anda telah berhasil disimpan ke dalam sistem.')
CheerfulNotification::getByKey('profile.saved.title'),
CheerfulNotification::getByKey('profile.saved.body')
)->send();
if (! filled($this->form->getState()['password'] ?? null)) {
@ -263,8 +263,8 @@ protected function afterSave(): void
session()->regenerateToken();
CheerfulNotification::info(
CheerfulNotification::getMessage('Sesi Berakhir 🔐', 'Keamanan Diperbarui'),
CheerfulNotification::getMessage('Anda telah mengubah kata sandi. Silakan masuk kembali dengan kata sandi baru Anda ya. 😉👋', 'Kata sandi Anda telah berhasil diubah. Harap lakukan login kembali menggunakan kata sandi yang baru untuk alasan keamanan.')
CheerfulNotification::getByKey('profile.password_changed.title'),
CheerfulNotification::getByKey('profile.password_changed.body')
)->send();
$this->redirect(filament()->getLoginUrl());

View File

@ -81,8 +81,8 @@ protected function handleRegistration(array $data): Model
$user->assignRole('Perusahaan');
CheerfulNotification::success(
CheerfulNotification::getMessage('Selamat Datang! 👋🎉', 'Pendaftaran Berhasil'),
CheerfulNotification::getMessage("Halooo, {$user->name}!, terima kasih sudah bergabung! Akunmu berhasil dibuat. Silakan verifikasi alamat surelmu! 🚀✨", "Selamat datang, {$user->name}. Akun Anda telah berhasil dibuat. Silakan periksa email Anda untuk melakukan verifikasi.")
CheerfulNotification::getByKey('auth.registration.success.title'),
CheerfulNotification::getByKey('auth.registration.success.body', ['name' => $user->name])
)
->send();
@ -90,8 +90,8 @@ protected function handleRegistration(array $data): Model
->get()
->each(function ($admin) use ($user): void {
$admin->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Warga Baru Nih! 👋🎉', 'Pendaftaran Pengguna Baru'),
'body' => CheerfulNotification::getMessage("Halo Admin! {$user->name} baru saja mendaftar. Yuk cek kelengkapannya! 🚀", "Pengguna baru {$user->name} telah mendaftar ke dalam sistem."),
'title' => CheerfulNotification::getByKey('auth.registration.admin_notify.title'),
'body' => CheerfulNotification::getByKey('auth.registration.admin_notify.body', ['name' => $user->name]),
'action' => [
Action::make('view')
->label('Lihat')

View File

@ -184,8 +184,8 @@ public static function form(Schema $schema): Schema
return $schema
->components([
Section::make(fn () => CheerfulNotification::getMessage('Informasi Perusahaan 🏗️✨', 'Profil Perusahaan'))
->description(fn () => CheerfulNotification::getMessage('Kelola informasi perusahaan Anda biar tetap resmi dan kredibel! 🚀✨', 'Kelola informasi detail perusahaan Anda di sini.'))
Section::make(fn () => CheerfulNotification::getByKey('company.section.title'))
->description(fn () => CheerfulNotification::getByKey('company.section.description'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-building-office-2' : null)
->schema([
TextInput::make('name')
@ -231,7 +231,7 @@ public static function form(Schema $schema): Schema
->schema(
array_merge(
[
Section::make(fn () => CheerfulNotification::getMessage('NIK Direktur 👤✨', 'NIK Direktur'))
Section::make(fn () => CheerfulNotification::getByKey('company.nik_section.title'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-user' : null)
->schema([
TextInput::make('director_nik')
@ -256,7 +256,7 @@ public static function form(Schema $schema): Schema
collect($documents)
->map(function (array $doc): Section {
return Section::make(fn () => CheerfulNotification::getMessage($doc['title'].' 📄✨', $doc['title']))
return Section::make(fn () => CheerfulNotification::getByKey('general.empty_msg', ['doc__title' => $doc['title']]))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null)
->schema([
TextInput::make($doc['text_name'])
@ -293,8 +293,8 @@ public function saveAction(): Action
return Action::make('save')
->label('Simpan')
->modalHeading(fn () => CheerfulNotification::getMessage('Ajukan Perubahan Profil 📝✨', 'Ubah Profil Perusahaan'))
->modalDescription(fn () => CheerfulNotification::getMessage('Yakin ingin mengubah data perusahaan? Jelaskan alasannya supaya proses verifikasi makin lancar! 😊', 'Silakan masukkan alasan Anda melakukan perubahan profil perusahaan.'))
->modalHeading(fn () => CheerfulNotification::getByKey('company.save.title'))
->modalDescription(fn () => CheerfulNotification::getByKey('company.save.description'))
->modal($needsReview)
->schema(
$needsReview
@ -330,8 +330,8 @@ public function performSave(array $data, bool $needsReview = false): void
if ($existingRequest) {
CheerfulNotification::warning(
CheerfulNotification::getMessage('Pengajuan Sudah Ada ⏳', 'Pengajuan Sedang Diproses'),
CheerfulNotification::getMessage('Masih ada pengajuan perubahan data yang sedang menunggu verifikasi. Silakan tunggu hingga selesai diproses.', 'Pengajuan perubahan data perusahaan Anda masih dalam proses verifikasi oleh admin.')
CheerfulNotification::getByKey('data_change.existing.title'),
CheerfulNotification::getByKey('data_change.existing.body')
)
->send();
@ -396,8 +396,8 @@ public function performSave(array $data, bool $needsReview = false): void
if (empty($changedFields)) {
CheerfulNotification::info(
CheerfulNotification::getMessage('Belum ada yang berubah ✨', 'Tidak Ada Perubahan'),
CheerfulNotification::getMessage('Ubah data terlebih dulu lalu simpan kembali 💪', 'Silakan ubah data terlebih dahulu sebelum melakukan penyimpanan.')
CheerfulNotification::getByKey('data_change.no_change.title'),
CheerfulNotification::getByKey('data_change.no_change.body')
)
->send();
@ -414,8 +414,8 @@ public function performSave(array $data, bool $needsReview = false): void
]);
CheerfulNotification::success(
CheerfulNotification::getMessage('Permohonan Berhasil 🎉', 'Permohonan Berhasil'),
CheerfulNotification::getMessage('Data sudah dikirim dan sedang menunggu verifikasi admin ⏳', 'Permohonan perubahan data perusahaan telah berhasil dikirimkan.')
CheerfulNotification::getByKey('data_change.success.title'),
CheerfulNotification::getByKey('data_change.success.body')
)
->send();
@ -423,8 +423,8 @@ public function performSave(array $data, bool $needsReview = false): void
->get()
->each(function ($admin) use ($dataChangeRequest): void {
$admin->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Ada Pengajuan Perubahan Data ✨', 'Pengajuan Perubahan Perusahaan'),
'body' => CheerfulNotification::getMessage('Halooo Admin! 👋 '.auth()->user()->name.' baru saja mengajukan perubahan data. Yuk, cek detailnya dan lakukan verifikasi ya! 🚀', 'Pengguna '.auth()->user()->name.' telah mengajukan perubahan data perusahaan.'),
'title' => CheerfulNotification::getByKey('data_change.admin_notify.title'),
'body' => CheerfulNotification::getByKey('data_change.admin_notify.body', ['name' => auth()->user()->name]),
'action' => [
Action::make('view')
->label('Lihat')

View File

@ -157,8 +157,8 @@ public static function form(Schema $schema): Schema
return $schema
->components([
Section::make(fn () => CheerfulNotification::getMessage('Detail Informasi 📰✨', 'Informasi Media'))
->description(fn () => CheerfulNotification::getMessage('Kelola informasi media Anda biar tetap eksis dan terpercaya! 🚀✨', 'Kelola informasi detail media Anda di sini.'))
Section::make(fn () => CheerfulNotification::getByKey('media.section.title'))
->description(fn () => CheerfulNotification::getByKey('media.section.description'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-newspaper' : null)
->schema([
TextInput::make('name')
@ -205,7 +205,7 @@ public static function form(Schema $schema): Schema
->schema(
collect($documents)
->map(function (array $doc): Section {
return Section::make(fn () => CheerfulNotification::getMessage($doc['title'].' 📄✨', $doc['title']))
return Section::make(fn () => CheerfulNotification::getByKey('general.empty_msg', ['doc__title' => $doc['title']]))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null)
->schema([
TextInput::make($doc['text_name'])
@ -240,8 +240,8 @@ public function saveAction(): Action
return Action::make('save')
->label('Simpan')
->modalHeading(fn () => CheerfulNotification::getMessage('Ajukan Perubahan Media 📝✨', 'Ubah Data Media'))
->modalDescription(fn () => CheerfulNotification::getMessage('Mau mengubah data media? Sertakan alasan yang jelas ya biar admin makin yakin! 😊', 'Silakan masukkan alasan Anda melakukan perubahan data media.'))
->modalHeading(fn () => CheerfulNotification::getByKey('media.save.title'))
->modalDescription(fn () => CheerfulNotification::getByKey('media.save.description'))
->modal($needsReview)
->schema(
$needsReview
@ -271,8 +271,8 @@ public function performSave(array $data = [], bool $needsReview = false): void
if ($existingRequest) {
CheerfulNotification::warning(
CheerfulNotification::getMessage('Pengajuan Sudah Ada ⏳', 'Pengajuan Sedang Diproses'),
CheerfulNotification::getMessage('Masih ada pengajuan perubahan data yang sedang menunggu verifikasi. Silakan tunggu hingga selesai diproses.', 'Pengajuan perubahan data media Anda masih dalam proses verifikasi oleh admin.')
CheerfulNotification::getByKey('data_change.existing.title'),
CheerfulNotification::getByKey('data_change.existing.body')
)
->send();
@ -337,8 +337,8 @@ public function performSave(array $data = [], bool $needsReview = false): void
if (empty($changedFields)) {
CheerfulNotification::info(
CheerfulNotification::getMessage('Belum ada yang berubah ✨', 'Tidak Ada Perubahan'),
CheerfulNotification::getMessage('Ubah data terlebih dulu lalu simpan kembali 💪', 'Silakan ubah data terlebih dahulu sebelum melakukan penyimpanan.')
CheerfulNotification::getByKey('data_change.no_change.title'),
CheerfulNotification::getByKey('data_change.no_change.body')
)
->send();
@ -355,8 +355,8 @@ public function performSave(array $data = [], bool $needsReview = false): void
]);
CheerfulNotification::success(
CheerfulNotification::getMessage('Permohonan Berhasil 🎉', 'Permohonan Berhasil'),
CheerfulNotification::getMessage('Data sudah dikirim dan sedang menunggu verifikasi admin ⏳', 'Permohonan perubahan data media telah berhasil dikirimkan.')
CheerfulNotification::getByKey('data_change.success.title'),
CheerfulNotification::getByKey('data_change.success.body')
)
->send();
@ -364,8 +364,8 @@ public function performSave(array $data = [], bool $needsReview = false): void
->get()
->each(function ($admin) use ($dataChangeRequest): void {
$admin->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Ada Pengajuan Perubahan Data Media ✨', 'Pengajuan Perubahan Media'),
'body' => CheerfulNotification::getMessage('Halooo Admin! 👋 '.auth()->user()->name.' baru saja mengajukan perubahan data media. Yuk, cek detailnya! 🚀', 'Pengguna '.auth()->user()->name.' telah mengajukan perubahan data media.'),
'title' => CheerfulNotification::getByKey('data_change.admin_notify.title'),
'body' => CheerfulNotification::getByKey('data_change.admin_notify.body', ['name' => auth()->user()->name]),
'action' => [
Action::make('view')
->label('Lihat')

View File

@ -37,8 +37,8 @@ public function form(Schema $schema): Schema
{
return $schema
->components([
Section::make(fn () => CheerfulNotification::getMessage('Informasi Dasar 📋✨', 'Informasi Dasar'))
->description(fn () => CheerfulNotification::getMessage('Atur info penting website kita di sini biar makin lengkap! 🚀😊', 'Silakan atur informasi dasar situs web pada bagian ini.'))
Section::make(fn () => CheerfulNotification::getByKey('settings.general.basic_info.title'))
->description(fn () => CheerfulNotification::getByKey('settings.general.basic_info.description'))
->schema([
TextInput::make('site_name')
->label('Nama')
@ -84,8 +84,8 @@ public function form(Schema $schema): Schema
->columnSpanFull(),
])->columnSpan(2),
Section::make(fn () => CheerfulNotification::getMessage('Logo & Ikon 🖼️✨', 'Logo & Ikon'))
->description(fn () => CheerfulNotification::getMessage('Unggah logo dan ikon biar branding kita makin cakep! 🎨👌', 'Silakan unggah logo dan ikon untuk keperluan branding situs web.'))
Section::make(fn () => CheerfulNotification::getByKey('settings.general.logo_icon.title'))
->description(fn () => CheerfulNotification::getByKey('settings.general.logo_icon.description'))
->schema([
FileUpload::make('site_logo')
->label('Logo')

View File

@ -35,8 +35,8 @@ public function form(Schema $schema): Schema
{
return $schema
->components([
Section::make(fn () => CheerfulNotification::getMessage('Search Engine Optimization 🔍✨', 'Optimasi Mesin Pencari (SEO)'))
->description(fn () => CheerfulNotification::getMessage('Atur kata kunci dan deskripsi biar website kita gampang dicari orang ya! 🚀📈', 'Atur kata kunci dan deskripsi untuk meningkatkan visibilitas situs web pada mesin pencari.'))
Section::make(fn () => CheerfulNotification::getByKey('settings.seo.section.title'))
->description(fn () => CheerfulNotification::getByKey('settings.seo.section.description'))
->schema([
TextInput::make('title')
->label('SEO Title')

View File

@ -35,8 +35,8 @@ public function form(Schema $schema): Schema
{
return $schema
->components([
Section::make(fn () => CheerfulNotification::getMessage('Link Media Sosial 🔗✨', 'Tautan Media Sosial'))
->description(fn () => CheerfulNotification::getMessage('Hubungkan semua media sosial resmi kita di sini untuk menjangkau lebih banyak orang! 🌐🤩', 'Silakan masukkan tautan media sosial resmi perusahaan pada bagian ini.'))
Section::make(fn () => CheerfulNotification::getByKey('settings.social_media.section.title'))
->description(fn () => CheerfulNotification::getByKey('settings.social_media.section.description'))
->schema([
Grid::make(2)
->schema([

View File

@ -112,17 +112,17 @@ public function submitVerificationAction(): Action
->icon('heroicon-o-paper-airplane')
->color('primary')
->requiresConfirmation()
->modalHeading(fn () => CheerfulNotification::getMessage('Ajukan Verifikasi Sekarang? 🚀✨', 'Ajukan Verifikasi'))
->modalHeading(fn () => CheerfulNotification::getByKey('verification.submit.title'))
->modalDescription(function () use ($progress): string {
if (! $progress['isDataComplete']) {
return CheerfulNotification::getMessage('Aduh, data belum lengkap nih! 😅 Silakan lengkapi dulu bagian: '.implode(', ', $progress['missingData']).' ya!', 'Data belum lengkap. Silakan lengkapi bagian: '.implode(', ', $progress['missingData']).'.');
return CheerfulNotification::getByKey('verification.submit.description.incomplete', ['missing' => implode(', ', $progress['missingData'])]);
}
if ($this->verificationRequest && $this->verificationRequest->status === VerificationStatus::NEED_REVISION) {
return CheerfulNotification::getMessage('Ayo kirim ulang perbaikannya! Pastikan semuanya sudah sesuai catatan admin biar langsung gaspol! 💪✨', 'Silakan kirimkan kembali perbaikan data Anda sesuai dengan catatan Admin.');
return CheerfulNotification::getByKey('verification.submit.description.revision');
}
return CheerfulNotification::getMessage('Apakah Anda yakin ingin mengajukan verifikasi? Pastikan semua data sudah benar and lengkap ya! Pasti bisa! 😊👍', 'Apakah Anda yakin ingin mengajukan verifikasi? Pastikan seluruh data yang diinput telah sesuai.');
return CheerfulNotification::getByKey('verification.submit.description.default');
})
->modalSubmitActionLabel('Ya, Ajukan')
->visible(fn (): bool => $progress['canSubmit'])
@ -130,8 +130,8 @@ public function submitVerificationAction(): Action
->action(function () use ($progress): void {
if (! $progress['isDataComplete']) {
CheerfulNotification::danger(
CheerfulNotification::getMessage('Data Belum Lengkap! 😅', 'Data Tidak Lengkap'),
CheerfulNotification::getMessage('Silakan lengkapi data terlebih dahulu sebelum mengajukan verifikasi ya: '.implode(', ', $progress['missingData']), 'Silakan lengkapi seluruh data wajib sebelum mengajukan verifikasi: '.implode(', ', $progress['missingData']))
CheerfulNotification::getByKey('verification.incomplete.title'),
CheerfulNotification::getByKey('verification.incomplete.body', ['missing' => implode(', ', $progress['missingData'])])
)->send();
return;
@ -142,8 +142,8 @@ public function submitVerificationAction(): Action
$this->verificationRequest = $this->submitVerification();
CheerfulNotification::success(
CheerfulNotification::getMessage('Berhasil Diajukan! 🚀', 'Berhasil Diajukan'),
CheerfulNotification::getMessage('Yeay! Pengajuan verifikasi Anda sudah terkirim ke Admin. Mohon ditunggu ya, semoga hasilnya memuaskan! ✨', 'Pengajuan verifikasi Anda telah berhasil dikirimkan ke pihak Admin untuk diproses.')
CheerfulNotification::getByKey('verification.success.title'),
CheerfulNotification::getByKey('verification.success.body')
)->send();
User::superAdmin()
@ -153,11 +153,11 @@ public function submitVerificationAction(): Action
$admin->notify(new BroadcastNotification([
'title' => $isRevision
? CheerfulNotification::getMessage('Pembaruan Data Verifikasi ✨', 'Pembaruan Data Verifikasi')
: CheerfulNotification::getMessage('Ada Pengajuan Verifikasi Baru! 🚀', 'Pengajuan Verifikasi Baru'),
? CheerfulNotification::getByKey('verification.admin_notify.title.revision')
: CheerfulNotification::getByKey('verification.admin_notify.title.new'),
'body' => $isRevision
? CheerfulNotification::getMessage("Cihuy! {$user->name} baru saja memperbarui data verifikasi untuk perusahaan {$user->company->name}. Yuk, cek perubahannya!", "Pengguna {$user->name} telah memperbarui data verifikasi untuk perusahaan {$user->company->name}.")
: CheerfulNotification::getMessage("Halo Admin! {$user->name} baru saja mengajukan verifikasi data untuk perusahaan {$user->company->name}. Segera diproses ya! 😊", "Pengguna {$user->name} telah mengajukan verifikasi data untuk perusahaan {$user->company->name}."),
? CheerfulNotification::getByKey('verification.admin_notify.body.revision', ['name' => $user->name, 'company' => $user->company->name])
: CheerfulNotification::getByKey('verification.admin_notify.body.new', ['name' => $user->name, 'company' => $user->company->name]),
'action' => [
Action::make('view')
->label('Lihat')
@ -334,7 +334,7 @@ protected function getAlertData(): ?array
'type' => 'approved',
'icon' => 'check-circle',
'title' => 'Verifikasi Diterima',
'message' => 'Verifikasi Anda telah diterima dan disetujui oleh admin. Sekarang Anda sudah resmi terverifikasi dan bekerja sama dengan kami!',
'message' => CheerfulNotification::getByKey('verification.alert.approved.body'),
'color' => 'success',
];
}
@ -343,8 +343,8 @@ protected function getAlertData(): ?array
return [
'type' => 'pending',
'icon' => 'clock',
'title' => 'Menunggu Verifikasi',
'message' => 'Data Anda sedang dalam proses verifikasi oleh admin. Mohon tunggu.',
'title' => CheerfulNotification::getByKey('verification.alert.pending.title'),
'message' => CheerfulNotification::getByKey('verification.alert.pending.body'),
'color' => 'info',
'animate' => true,
];

View File

@ -19,8 +19,8 @@ protected function setUp(): void
$this->label('Balas')
->icon(Heroicon::OutlinedChatBubbleLeftRight)
->color('success')
->modalHeading(fn () => CheerfulNotification::getMessage('Balas Pesan Kontak ✨✉️', 'Balas Pesan Kontak'))
->modalDescription(fn () => CheerfulNotification::getMessage('Tuliskan jawaban terbaik Anda di sini ya! Hati-hati, setelah dikirim tidak bisa ditarik kembali. 👋😊', 'Silakan masukkan balasan Anda untuk pesan kontak ini.'))
->modalHeading(fn () => CheerfulNotification::getByKey('contact.reply_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('contact.reply_desc'))
->schema([
Textarea::make('reply_message')
->label('Pesan Balasan')
@ -40,8 +40,8 @@ protected function setUp(): void
]);
CheerfulNotification::success(
CheerfulNotification::getMessage('Balasan Terkirim! 🚀✉️', 'Balasan Berhasil Dikirim'),
CheerfulNotification::getMessage('Pesan balasan Anda sudah meluncur ke email pengirim. Semoga membantu mereka ya! 😊', 'Pesan balasan telah berhasil dikirim ke alamat email pengirim.')
CheerfulNotification::getByKey('contact.reply_success'),
CheerfulNotification::getByKey('contact.reply_success_desc')
)->send();
})
->visible(fn (Contact $record): bool => $record->replied_at === null);

View File

@ -52,8 +52,8 @@ public static function infolist(Schema $schema): Schema
{
return $schema
->schema([
Section::make(fn () => CheerfulNotification::getMessage('Informasi Pengirim 📧', 'Informasi Pengirim'))
->description(fn () => CheerfulNotification::getMessage('Cek detail identitas pengirim pesan biar makin kenal! 📧✨', 'Detail mengenai identitas pengirim pesan.'))
Section::make(fn () => CheerfulNotification::getByKey('contact.sender_info_title'))
->description(fn () => CheerfulNotification::getByKey('contact.sender_info_desc'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-user' : null)
->schema([
Grid::make(4)
@ -78,8 +78,8 @@ public static function infolist(Schema $schema): Schema
])
->columnSpanFull(),
Section::make(fn () => CheerfulNotification::getMessage('Isi Pesan 💬', 'Isi Pesan'))
->description(fn () => CheerfulNotification::getMessage('Yuk, baca pesan lengkap yang dikirimkan oleh pengguna! 💬✨', 'Pesan lengkap yang dikirimkan oleh pengguna.'))
Section::make(fn () => CheerfulNotification::getByKey('contact.message_content_title'))
->description(fn () => CheerfulNotification::getByKey('contact.message_content_desc'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-chat-bubble-left-right' : null)
->schema([
TextEntry::make('message')
@ -88,8 +88,8 @@ public static function infolist(Schema $schema): Schema
])
->columnSpanFull(),
Section::make(fn () => CheerfulNotification::getMessage('Riwayat Balasan 📤', 'Riwayat Balasan'))
->description(fn () => CheerfulNotification::getMessage('Lihat detail tanggapan yang sudah Admin berikan sebelumnya! 📤✨', 'Detail mengenai tanggapan yang telah diberikan.'))
Section::make(fn () => CheerfulNotification::getByKey('contact.reply_history_title'))
->description(fn () => CheerfulNotification::getByKey('contact.reply_history_desc'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-paper-airplane' : null)
->schema([
TextEntry::make('repliedBy.name')
@ -175,7 +175,7 @@ public static function table(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedEnvelope)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada kontak atau pesan masuk nih! Santai dulu yuk. ✨✅', 'Belum ada kontak atau pesan masuk yang tersedia.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('contact.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -35,8 +35,8 @@ protected function setUp(): void
$cooperationMedia->update(['status' => ApprovalStatus::ACCEPTED]);
CheerfulNotification::success(
CheerfulNotification::getMessage('Berhasil Diterima! ✅✨', 'Tawaran Diterima'),
CheerfulNotification::getMessage('Mantap! Anda telah menerima penawaran kerja sama ini. Silakan lanjut ke tahap pengajuan proposal ya! 💪', 'Anda telah menyetujui penawaran kerja sama ini. Silakan lanjutkan ke tahap pengiriman proposal.')
CheerfulNotification::getByKey('cooperation.offer_accepted'),
CheerfulNotification::getByKey('cooperation.offer_accepted_desc')
)->send();
// Notify Admins
@ -44,8 +44,8 @@ protected function setUp(): void
->get()
->each(function ($admin) use ($record, $cooperationMedia): void {
$admin->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Kabar Baik! Tawaran Diterima ✨🤝', 'Tawaran Kerja Sama Disetujui Media'),
'body' => CheerfulNotification::getMessage("Media {$cooperationMedia->partnerMedia->name} baru saja menerima penawaran kerja sama \"{$record->title}\". Siap-siap cek proposal mereka ya! 😊", "Pihak media {$cooperationMedia->partnerMedia->name} telah menyetujui penawaran kerja sama \"{$record->title}\"."),
'title' => CheerfulNotification::getByKey('cooperation.offer_accepted_by_media'),
'body' => CheerfulNotification::getByKey('notification.media_accepted_offer', ['cooperationMedia__partnerMedia__name' => $cooperationMedia->partnerMedia->name, 'record__title' => $record->title]),
'action' => [
Action::make('view')
->label('Lihat')

View File

@ -19,16 +19,16 @@ protected function setUp(): void
->icon(Heroicon::OutlinedCheckBadge)
->color('success')
->requiresConfirmation()
->modalHeading(fn () => CheerfulNotification::getMessage('Selesaikan Kerja Sama? 🏁✨', 'Selesaikan Kerja Sama'))
->modalDescription(fn () => CheerfulNotification::getMessage('Yakin mau menyelesaikan kerja sama ini? Pastikan semua pembayaran ke media sudah lunas dan aman ya! 🤝😊', 'Apakah Anda yakin ingin menyelesaikan kerja sama ini? Pastikan seluruh kewajiban pembayaran telah terpenuhi.'))
->modalHeading(fn () => CheerfulNotification::getByKey('cooperation.complete_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('cooperation.complete_desc'))
->action(function (Cooperation $record): void {
// Verify all accepted media are paid
$acceptedMedia = $record->cooperationMedia()->accepted()->get();
if ($acceptedMedia->isEmpty()) {
CheerfulNotification::danger(
CheerfulNotification::getMessage('Tidak Ada Media! ❌', 'Data Media Kosong'),
CheerfulNotification::getMessage('Tidak ada media yang menerima kerja sama ini. Tidak dapat diselesaikan.', 'Proses tidak dapat dilanjutkan karena tidak ada media yang terlibat dalam kerja sama ini.')
CheerfulNotification::getByKey('cooperation.media_empty'),
CheerfulNotification::getByKey('cooperation.media_empty_desc')
)->send();
return;
@ -40,8 +40,8 @@ protected function setUp(): void
if ($unpaidMedia->isNotEmpty()) {
CheerfulNotification::danger(
CheerfulNotification::getMessage('Pembayaran Belum Lunas! ⚠️', 'Pembayaran Belum Terpenuhi'),
CheerfulNotification::getMessage('Masih ada media yang belum dibayar. Harap selesaikan pembayaran untuk semua media yang menerima kerja sama.', 'Terdapat kewajiban pembayaran yang belum diselesaikan untuk media terkait.')
CheerfulNotification::getByKey('cooperation.payment_unfulfilled'),
CheerfulNotification::getByKey('cooperation.payment_unfulfilled_desc')
)->send();
$this->halt();
@ -59,8 +59,8 @@ protected function setUp(): void
]);
CheerfulNotification::success(
CheerfulNotification::getMessage('Kerja Sama Selesai! 🎉✨', 'Kerja Sama Berhasil Diselesaikan'),
CheerfulNotification::getMessage('Alhamdulillah! Kerja sama ini telah resmi diselesaikan. Terima kasih atas kerja samanya! 🙌😊', 'Proses kerja sama ini telah resmi ditutup dan diselesaikan.')
CheerfulNotification::getByKey('cooperation.completed_success'),
CheerfulNotification::getByKey('cooperation.completed_desc')
)->send();
})
->visible(function (Cooperation $record): bool {

View File

@ -82,8 +82,8 @@ protected function setUp(): void
$partnerUser = $partnerMedia->company?->user;
if ($partnerUser) {
$partnerUser->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Tugas Baru Telah Menanti! 📝✨', 'Penugasan Kerja Sama Baru'),
'body' => CheerfulNotification::getMessage("Halo! Admin sudah menetapkan tugas untuk kerja sama \"{$record->title}\". Yuk, cek detail tugasnya dan mulai buat laporannya! Semangat! 💪😊", "Admin telah menetapkan penugasan baru untuk kerja sama \"{$record->title}\". Silakan tinjau detail tugas dan laporan yang diperlukan."),
'title' => CheerfulNotification::getByKey('cooperation.new_assignment'),
'body' => CheerfulNotification::getByKey('notification.admin_assigned_task', ['record__title' => $record->title]),
'action' => [
Action::make('view')
->label('Lihat')
@ -94,12 +94,12 @@ protected function setUp(): void
}
CheerfulNotification::success(
CheerfulNotification::getMessage('Penugasan Berhasil Dibuat! 🚀✨', 'Penugasan Berhasil Dibuat'),
CheerfulNotification::getMessage('Mantap! Penugasan telah dibuat dan semua media terkait sudah diberi tahu. Mari kita pantau progresnya! 💪', 'Penugasan telah berhasil dibuat dan seluruh media terkait telah dinotifikasi.')
CheerfulNotification::getByKey('cooperation.assignment_created_success'),
CheerfulNotification::getByKey('cooperation.assignment_created_desc')
)->send();
})
->modalHeading(fn () => CheerfulNotification::getMessage('Buat Penugasan Baru 📝✨', 'Buat Penugasan Baru'))
->modalDescription(fn () => CheerfulNotification::getMessage('Waktunya bagi-bagi tugas! Tentukan detail penugasan untuk para media biar mereka bisa langsung gaspol! 🚀💪', 'Silakan tentukan detail penugasan untuk pihak media eksternal.'))
->modalHeading(fn () => CheerfulNotification::getByKey('cooperation.create_assignment_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('cooperation.create_assignment_desc'))
->modalSubmitActionLabel('Simpan')
->visible(function (Cooperation $record): bool {
$user = auth()->user();

View File

@ -20,8 +20,8 @@ protected function setUp(): void
->icon(Heroicon::OutlinedBanknotes)
->color('success')
->requiresConfirmation()
->modalHeading(fn () => CheerfulNotification::getMessage('Lanjut ke Pembayaran? 💸💳', 'Lanjutkan ke Pembayaran'))
->modalDescription(fn () => CheerfulNotification::getMessage('Siap buat lanjut ke tahap pembayaran? Pastikan semua laporan sudah diverifikasi dulu ya! ✅😊', 'Apakah Anda yakin ingin melanjutkan ke tahap pembayaran? Pastikan seluruh laporan telah diverifikasi.'))
->modalHeading(fn () => CheerfulNotification::getByKey('cooperation.proceed_to_payment_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('cooperation.proceed_to_payment_desc'))
->action(function (Cooperation $record): void {
$record->update([
'status' => CooperationStatus::PAYMENT,
@ -29,8 +29,8 @@ protected function setUp(): void
]);
CheerfulNotification::success(
CheerfulNotification::getMessage('Tahap Pembayaran Dimulai! 💸✨', 'Tahap Pembayaran Aktif'),
CheerfulNotification::getMessage('Kerja sama telah dipindahkan ke tahap pembayaran. Silakan proses pembayarannya ya! 😊', 'Status kerja sama telah dialihkan ke tahap pembayaran.')
CheerfulNotification::getByKey('cooperation.payment_stage_active'),
CheerfulNotification::getByKey('cooperation.payment_stage_changed_desc')
)->send();
})
->visible(function (Cooperation $record): bool {

View File

@ -33,8 +33,8 @@ protected function setUp(): void
$cooperationMedia->update(['status' => ApprovalStatus::REJECTED]);
CheerfulNotification::info(
CheerfulNotification::getMessage('Berhasil Ditolak 🙏', 'Tawaran Kerja Sama Ditolak'),
CheerfulNotification::getMessage('Terima kasih atas konfirmasinya. Pesan penolakan telah diteruskan ke Admin. 😊', 'Penolakan penawaran kerja sama telah berhasil dikirimkan ke pihak Admin.')
CheerfulNotification::getByKey('cooperation.offer_rejected'),
CheerfulNotification::getByKey('cooperation.offer_rejection_sent')
)->send();
// Notify Admins
@ -42,8 +42,8 @@ protected function setUp(): void
->get()
->each(function ($admin) use ($record, $cooperationMedia): void {
$admin->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Yah, Tawaran Ditolak 😔🤝', 'Tawaran Kerja Sama Ditolak Media'),
'body' => CheerfulNotification::getMessage("Media {$cooperationMedia->partnerMedia->name} baru saja menolak penawaran kerja sama \"{$record->title}\". Mungkin di lain waktu ya! 🙏", "Pihak media {$cooperationMedia->partnerMedia->name} telah menolak penawaran kerja sama \"{$record->title}\"."),
'title' => CheerfulNotification::getByKey('cooperation.offer_rejected_media'),
'body' => CheerfulNotification::getByKey('notification.media_rejected_offer', ['cooperationMedia__partnerMedia__name' => $cooperationMedia->partnerMedia->name, 'record__title' => $record->title]),
]));
});
}

View File

@ -93,8 +93,8 @@ protected function setUp(): void
}
CheerfulNotification::success(
CheerfulNotification::getMessage('Berhasil Diajukan! 🚀', 'Proposal Berhasil Dikirim'),
CheerfulNotification::getMessage('Yeay! Proposal kerja sama Anda sudah terkirim ke Admin. Mohon ditunggu ya, semoga hasilnya memuaskan! ✨', 'Proposal kerja sama Anda telah berhasil dikirimkan ke pihak Admin.')
CheerfulNotification::getByKey('cooperation.proposal_sent_success'),
CheerfulNotification::getByKey('cooperation.proposal_approved_desc')
)->send();
// Notify Admin
@ -105,11 +105,11 @@ protected function setUp(): void
$admin->notify(new BroadcastNotification([
'title' => $isRevision
? CheerfulNotification::getMessage('Pembaruan Proposal Kerja Sama ✨', 'Pembaruan Proposal Kerja Sama')
: CheerfulNotification::getMessage('Ada Proposal Kerja Sama Baru! 🚀', 'Proposal Kerja Sama Baru'),
? CheerfulNotification::getByKey('cooperation.proposal_update')
: CheerfulNotification::getByKey('cooperation.new_proposal'),
'body' => $isRevision
? CheerfulNotification::getMessage("Cihuy! {$user->name} baru saja memperbarui proposal kerja sama untuk media {$cooperationMedia->partnerMedia->name} pada kampanye {$record->title}. Yuk, cek perubahannya!", "Pengguna {$user->name} telah memperbarui proposal kerja sama untuk media {$cooperationMedia->partnerMedia->name} pada kampanye {$record->title}.")
: CheerfulNotification::getMessage("Halo Admin! {$user->name} baru saja mengajukan proposal kerja sama baru untuk media {$cooperationMedia->partnerMedia->name} pada kampanye {$record->title}. Segera diproses ya! 😊", "Pengguna {$user->name} telah mengajukan proposal kerja sama baru untuk media {$cooperationMedia->partnerMedia->name} pada kampanye {$record->title}."),
? CheerfulNotification::getByKey('notification.user_updated_proposal', ['user__name' => $user->name, 'cooperationMedia__partnerMedia__name' => $cooperationMedia->partnerMedia->name, 'record__title' => $record->title])
: CheerfulNotification::getByKey('notification.user_submitted_proposal', ['user__name' => $user->name, 'cooperationMedia__partnerMedia__name' => $cooperationMedia->partnerMedia->name, 'record__title' => $record->title]),
'action' => [
Action::make('view')
->label('Lihat')
@ -119,8 +119,8 @@ protected function setUp(): void
});
}
})
->modalHeading(fn () => CheerfulNotification::getMessage('Ajukan Proposal Kerja Sama 🚀📝', 'Ajukan Proposal Kerja Sama'))
->modalDescription(fn () => CheerfulNotification::getMessage('Ayo kirimkan proposal terbaikmu! Pastikan semua dokumen sudah lengkap ya biar admin makin sreg! ✨😊', 'Silakan ajukan proposal kerja sama Anda. Pastikan seluruh dokumen pendukung telah dilampirkan.'))
->modalHeading(fn () => CheerfulNotification::getByKey('cooperation.submit_proposal_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('cooperation.submit_proposal_desc'))
->modalSubmitActionLabel('Kirim Proposal')
->visible(function (Cooperation $record): bool {
$user = auth()->user();

View File

@ -63,15 +63,15 @@ protected function setUp(): void
]);
CheerfulNotification::success(
CheerfulNotification::getMessage('Pembayaran Berhasil! 💸✨', 'Pembayaran Berhasil Dicatat'),
CheerfulNotification::getMessage("Pembayaran untuk {$record->partnerMedia->name} telah berhasil dicatat.", "Proses pembayaran untuk {$record->partnerMedia->name} telah berhasil diselesaikan.")
CheerfulNotification::getByKey('cooperation.payment_recorded_success'),
CheerfulNotification::getByKey('notification.payment_processed', ['record__partnerMedia__name' => $record->partnerMedia->name])
)->send();
$partnerUser = $record->partnerMedia->company?->user;
if ($partnerUser) {
$partnerUser->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Pembayaran Telah Dikirim! 💸✨', 'Pembayaran Kerja Sama Telah Dikirim'),
'body' => CheerfulNotification::getMessage("Halo! Pembayaran untuk kerja sama \"{$record->cooperation->title}\" telah berhasil dikirim oleh Admin. Silakan cek detailnya ya! 😊", "Admin telah mengirimkan pembayaran untuk kerja sama \"{$record->cooperation->title}\". Silakan periksa detail transaksi Anda."),
'title' => CheerfulNotification::getByKey('cooperation.payment_sent'),
'body' => CheerfulNotification::getByKey('notification.payment_sent_desc', ['record__cooperation__title' => $record->cooperation->title]),
'action' => [
Action::make('view')
->label('Lihat')

View File

@ -22,8 +22,8 @@ protected function setUp(): void
->icon(Heroicon::OutlinedCheck)
->color('success')
->requiresConfirmation()
->modalHeading(fn () => CheerfulNotification::getMessage('Terima Proposal Ini? ✅✨', 'Terima Proposal'))
->modalDescription(fn () => CheerfulNotification::getMessage('Yakin ingin menerima proposal kerja sama ini? Pastikan profil medianya sudah oke semua ya! 😊', 'Apakah Anda yakin ingin menyetujui proposal kerja sama ini?'))
->modalHeading(fn () => CheerfulNotification::getByKey('cooperation.accept_proposal_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('cooperation.accept_proposal_desc'))
->action(function (CooperationProposal $record): void {
$record->update([
'status' => ApprovalStatus::ACCEPTED,
@ -31,16 +31,16 @@ protected function setUp(): void
]);
CheerfulNotification::success(
CheerfulNotification::getMessage('Proposal Diterima! ✅✨', 'Proposal Berhasil Disetujui'),
CheerfulNotification::getMessage("Mantap! Proposal dari '{$record->partnerMedia->name}' telah berhasil diterima. Mari kita lanjut ke tahap berikutnya! 💪", "Proposal kerja sama dari '{$record->partnerMedia->name}' telah berhasil disetujui.")
CheerfulNotification::getByKey('cooperation.proposal_approved_success'),
CheerfulNotification::getByKey('notification.proposal_from_rejected', ['record__partnerMedia__name' => $record->partnerMedia->name])
)->send();
// Notify User (Partner)
$partnerUser = $record->partnerMedia?->company?->user;
if ($partnerUser) {
$partnerUser->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Horee! Proposal Disetujui 🎉', 'Proposal Kerja Sama Disetujui'),
'body' => CheerfulNotification::getMessage('Yeay! Proposal kerja sama Anda telah disetujui oleh Admin. Mari kita lanjut ke tahap berikutnya! 🎊', 'Proposal kerja sama Anda telah disetujui oleh pihak Admin.'),
'title' => CheerfulNotification::getByKey('cooperation.proposal_approved'),
'body' => CheerfulNotification::getByKey('cooperation.proposal_approved_desc'),
'action' => [
Action::make('view')
->label('Lihat')

View File

@ -23,8 +23,8 @@ protected function setUp(): void
$this->label('Tolak')
->icon(Heroicon::OutlinedXMark)
->color('danger')
->modalHeading(fn () => CheerfulNotification::getMessage('Tolak Proposal Ini? 🛑🤔', 'Tolak Proposal'))
->modalDescription(fn () => CheerfulNotification::getMessage('Yakin ingin menolak proposal ini? Berikan alasan biar media bisa melakukan perbaikan ke depannya! 📝😊', 'Apakah Anda yakin ingin menolak proposal kerja sama ini? Harap berikan alasan penolakan.'))
->modalHeading(fn () => CheerfulNotification::getByKey('cooperation.reject_proposal_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('cooperation.reject_proposal_desc'))
->schema([
Textarea::make('reason')
->label('Alasan Penolakan')
@ -40,16 +40,16 @@ protected function setUp(): void
$record->rejectionReasons()->create(['reason' => $data['reason']]);
CheerfulNotification::warning(
CheerfulNotification::getMessage('Proposal Ditolak! 🛑', 'Proposal Ditolak'),
CheerfulNotification::getMessage("Proposal dari '{$record->partnerMedia->name}' telah ditolak. Media terkait akan segera mendapatkan notifikasi. 🙏", "Proposal kerja sama dari '{$record->partnerMedia->name}' telah ditolak.")
CheerfulNotification::getByKey('cooperation.proposal_rejected'),
CheerfulNotification::getByKey('notification.proposal_from_rejected', ['record__partnerMedia__name' => $record->partnerMedia->name])
)->send();
// Notify User (Partner)
$partnerUser = $record->partnerMedia?->company?->user;
if ($partnerUser) {
$partnerUser->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Maaf, Proposal Belum Diterima 😔', 'Pemberitahuan Penolakan Proposal'),
'body' => CheerfulNotification::getMessage("Yah, maaf banget... proposal kerja sama Anda belum bisa kami terima saat ini. 💔\n\nAlasan: {$data['reason']}", "Proposal kerja sama Anda telah ditolak oleh pihak Admin.\n\nAlasan: {$data['reason']}"),
'title' => CheerfulNotification::getByKey('cooperation.proposal_rejection_notice'),
'body' => CheerfulNotification::getByKey('notification.proposal_rejected_reason', ['data__reason' => $data['reason']]),
'action' => [
Action::make('view')
->label('Lihat')

View File

@ -27,15 +27,15 @@ protected function setUp(): void
]);
CheerfulNotification::success(
CheerfulNotification::getMessage('Laporan Diterima! ✅✨', 'Laporan Berhasil Disetujui'),
CheerfulNotification::getMessage("Laporan '{$record->title}' telah berhasil diproses. Notifikasi sudah dikirim ke media terkait! 💪", "Laporan '{$record->title}' telah disetujui dan notifikasi telah dikirimkan ke pihak media.")
CheerfulNotification::getByKey('cooperation.report_approved_success'),
CheerfulNotification::getByKey('notification.report_approved_notice', ['record__title' => $record->title])
)->send();
$partnerUser = $record->mediaTaskAssignment?->partnerMedia?->company?->user;
if ($partnerUser) {
$partnerUser->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Mantap! Laporan Diterima 🎊✨', 'Laporan Kerja Sama Disetujui'),
'body' => CheerfulNotification::getMessage("Hore! Laporan \"{$record->title}\" pada kerja sama \"{$record->mediaTaskAssignment->taskAssignment->cooperation->title}\" telah disetujui oleh Admin. Satu langkah lebih dekat! 🚀", "Laporan \"{$record->title}\" untuk kerja sama \"{$record->mediaTaskAssignment->taskAssignment->cooperation->title}\" telah disetujui oleh Admin."),
'title' => CheerfulNotification::getByKey('cooperation.report_cooperation_approved'),
'body' => CheerfulNotification::getByKey('notification.report_cooperation_approved', ['record__title' => $record->title, 'record__mediaTaskAssignment__taskAssignment__cooperation__title' => $record->mediaTaskAssignment->taskAssignment->cooperation->title]),
'action' => [
Action::make('view')
->label('Lihat')

View File

@ -29,8 +29,8 @@ protected function setUp(): void
->placeholder('Jelaskan alasan pengajuan ditolak...')
->required(),
])
->modalHeading(fn () => CheerfulNotification::getMessage('Tolak Laporan? 🛑🤔', 'Tolak Laporan'))
->modalDescription(fn () => CheerfulNotification::getMessage('Apakah Anda yakin ingin menolak laporan ini? Sertakan alasan biar media bisa segera memperbaikinya ya! 📝😊', 'Apakah Anda yakin ingin menolak laporan ini? Silakan berikan alasan penolakan untuk perbaikan oleh pihak media.'))
->modalHeading(fn () => CheerfulNotification::getByKey('cooperation.reject_report_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('cooperation.reject_proposal_desc'))
->action(function (Report $record, array $data): void {
$record->update([
'status' => ApprovalStatus::REJECTED,
@ -39,15 +39,15 @@ protected function setUp(): void
$record->rejectionReasons()->create(['reason' => $data['reason']]);
CheerfulNotification::warning(
CheerfulNotification::getMessage('Laporan Ditolak! 🛑', 'Laporan Ditolak'),
CheerfulNotification::getMessage("Laporan '{$record->title}' telah ditolak. Media terkait akan segera mendapatkan notifikasi untuk perbaikan. 🙏", "Laporan '{$record->title}' telah ditolak. Notifikasi perbaikan telah dikirimkan ke pihak media.")
CheerfulNotification::getByKey('cooperation.report_rejected'),
CheerfulNotification::getByKey('notification.report_rejected_notice', ['record__title' => $record->title])
)->send();
$partnerUser = $record->mediaTaskAssignment?->partnerMedia?->company?->user;
if ($partnerUser) {
$partnerUser->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Yah, Laporan Ditolak 🙁', 'Laporan Kerja Sama Ditolak'),
'body' => CheerfulNotification::getMessage("Halo! Laporan \"{$record->title}\" pada kerja sama \"{$record->mediaTaskAssignment->taskAssignment->cooperation->title}\" ditolak oleh Admin. 💪\n\nCatatan Admin: {$data['reason']}", "Laporan \"{$record->title}\" untuk kerja sama \"{$record->mediaTaskAssignment->taskAssignment->cooperation->title}\" ditolak oleh Admin.\n\nAlasan: {$data['reason']}"),
'title' => CheerfulNotification::getByKey('cooperation.report_cooperation_rejected'),
'body' => CheerfulNotification::getByKey('notification.report_rejected_reason', ['record__title' => $record->title, 'record__mediaTaskAssignment__taskAssignment__cooperation__title' => $record->mediaTaskAssignment->taskAssignment->cooperation->title, 'data__reason' => $data['reason']]),
'action' => [
Action::make('view')
->label('Lihat')

View File

@ -74,8 +74,8 @@ public static function infolist(Schema $schema): Schema
{
return $schema
->components([
Section::make(fn () => CheerfulNotification::getMessage('Informasi Kerja Sama 🤝', 'Informasi Kerja Sama'))
->description(fn () => CheerfulNotification::getMessage('Detail lengkap mengenai data kerja sama yang sedang berjalan. 🤝✨', 'Informasi detail mengenai pelaksanaan kerja sama.'))
Section::make(fn () => CheerfulNotification::getByKey('cooperation.info_title'))
->description(fn () => CheerfulNotification::getByKey('cooperation.info_desc'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-hand-raised' : null)
->headerActions([
Action::make('status')

View File

@ -68,8 +68,8 @@ protected function afterCreate(): void
$partnerUser = $media->company?->user;
if ($partnerUser) {
$partnerUser->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Ada Penawaran Kerja Sama Baru! 🤝✨', 'Penawaran Kerja Sama Baru'),
'body' => CheerfulNotification::getMessage("Halo! Admin baru saja menawarkan kerja sama \"{$record->title}\" untuk media {$media->name}. Yuk, cek detailnya dan berikan tanggapanmu! 😊", "Admin telah menawarkan kerja sama \"{$record->title}\" untuk media {$media->name}."),
'title' => CheerfulNotification::getByKey('cooperation.new_offer'),
'body' => CheerfulNotification::getByKey('notification.admin_offered_cooperation', ['record__title' => $record->title, 'media__name' => $media->name]),
'action' => [
Action::make('view')
->label('Lihat')

View File

@ -65,7 +65,7 @@ public function table(Table $table): Table
->visible(fn (CooperationMedia $record): bool => $record->status === ApprovalStatus::ACCEPTED && $record->payment()->exists()),
])
->emptyStateIcon(Heroicon::OutlinedNewspaper)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Daftar media pendukung masih kosong nih! Yuk, tambahkan media sekarang. 📰✨', 'Belum ada data media yang tersedia.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('cooperation.media_data_empty'))
->defaultSort('created_at', 'desc');
}

View File

@ -66,7 +66,7 @@ public function table(Table $table): Table
->headerActions([])
->recordActions([])
->emptyStateIcon(Heroicon::OutlinedCreditCard)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Ups! Belum ada data pembayaran yang tercatat nih. Sabar ya! 💸✨', 'Belum ada data pembayaran yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('cooperation.payment_empty'))
->defaultSort('created_at', 'desc');
}

View File

@ -108,14 +108,14 @@ public function table(Table $table): Table
DeleteBulkAction::make()
->successNotification(
fn () => CheerfulNotification::success(
CheerfulNotification::getMessage('Proposal Dihapus! 🗑️', 'Proposal Dihapus'),
CheerfulNotification::getMessage('Semua proposal yang dipilih telah berhasil dihapus dari sistem. 👋', 'Seluruh data proposal yang dipilih telah berhasil dihapus dari sistem.')
CheerfulNotification::getByKey('cooperation.proposal_deleted'),
CheerfulNotification::getByKey('cooperation.proposal_deleted_desc')
)
),
]),
])
->emptyStateIcon(Heroicon::OutlinedDocumentText)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada proposal yang masuk nih! Tenang, nanti juga ada yang tertarik kok. ✨🚀', 'Belum ada data proposal yang diajukan saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('cooperation.proposal_empty'))
->defaultSort('created_at', 'desc');
}

View File

@ -154,8 +154,8 @@ public function table(Table $table): Table
CreateAction::make()
->label('Buat Laporan')
->modalWidth(Width::Large)
->modalHeading(fn () => CheerfulNotification::getMessage('Sampaikan Laporan Baru 📝🚀', 'Buat Laporan Baru'))
->modalDescription(fn () => CheerfulNotification::getMessage('Ayo kirimkan hasil kerja kerasmu! Isi detail laporannya biar admin bisa langsung verifikasi ya! 💪✨', 'Silakan masukkan detail laporan pekerjaan Anda pada formulir di bawah ini.'))
->modalHeading(fn () => CheerfulNotification::getByKey('cooperation.create_report_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('cooperation.create_report_desc'))
->mutateDataUsing(function (array $data): array {
$taskAssignment = $this->getOwnerRecord()->taskAssignment;
@ -174,8 +174,8 @@ public function table(Table $table): Table
->successNotification(null)
->after(function (Report $record): void {
CheerfulNotification::success(
CheerfulNotification::getMessage('Laporan Berhasil Terkirim! 🚀✨', 'Laporan Berhasil Terkirim'),
CheerfulNotification::getMessage('Hore! Laporan Anda sudah masuk ke sistem. Admin akan segera memeriksanya. Terima kasih atas kerja kerasnya! 💪', 'Laporan Anda telah berhasil dikirimkan ke sistem dan sedang menunggu verifikasi admin.')
CheerfulNotification::getByKey('cooperation.report_sent_success'),
CheerfulNotification::getByKey('cooperation.report_sent_desc')
)->send();
// Notify Admins
@ -185,8 +185,8 @@ public function table(Table $table): Table
$user = auth()->user();
$admin->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Ada Laporan Baru! 📝✨', 'Laporan Kerja Sama Baru'),
'body' => CheerfulNotification::getMessage("Halo Admin! {$user->name} baru saja mengirimkan laporan \"{$record->title}\" untuk kerja sama \"{$this->getOwnerRecord()->title}\". Yuk, dicek! 😊", "Pengguna {$user->name} telah mengirimkan laporan baru \"{$record->title}\" untuk pengajuan kerja sama \"{$this->getOwnerRecord()->title}\"."),
'title' => CheerfulNotification::getByKey('auto_generated.msg_laporan_kerja_sama_baru'),
'body' => CheerfulNotification::getByKey('notification.user_submitted_report', ['user__name' => $user->name, 'record__title' => $record->title, 'this__getOwnerRecord____title' => $this->getOwnerRecord()->title]),
'action' => [
Action::make('view')
->label('Lihat')
@ -219,7 +219,7 @@ public function table(Table $table): Table
])
->toolbarActions([])
->emptyStateIcon(Heroicon::OutlinedInboxArrowDown)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada laporan yang dikirimkan nih! Yuk, kirimkan hasil kerjamu sekarang juga! 🚀✨', 'Belum ada data laporan yang diajukan saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('cooperation.report_empty'))
->defaultSort('created_at', 'desc');
}

View File

@ -73,23 +73,23 @@ public function table(Table $table): Table
&& ! $cooperation->taskAssignment()->exists();
})
->successNotification(fn () => CheerfulNotification::success(
CheerfulNotification::getMessage('Penugasan Dibuat! 🚀✨', 'Penugasan Berhasil'),
CheerfulNotification::getMessage('Tugas baru berhasil ditetapkan. Media terkait akan segera mengetahuinya! 💪', 'Tugas baru telah berhasil ditetapkan untuk pihak media.')
CheerfulNotification::getByKey('cooperation.assignment_success'),
CheerfulNotification::getByKey('cooperation.assignment_set_success')
)
),
])
->recordActions([
EditAction::make()
->successNotification(fn () => CheerfulNotification::success(
CheerfulNotification::getMessage('Penugasan Diperbarui! ✅', 'Penugasan Diperbarui'),
CheerfulNotification::getMessage('Perubahan pada penugasan berhasil disimpan dengan aman. 👍', 'Perubahan pada detail penugasan telah berhasil disimpan.')
CheerfulNotification::getByKey('cooperation.assignment_updated'),
CheerfulNotification::getByKey('cooperation.assignment_updated_desc')
)
),
DeleteAction::make()
->successNotification(fn () => CheerfulNotification::success(
CheerfulNotification::getMessage('Penugasan Dihapus! 🗑️', 'Penugasan Dihapus'),
CheerfulNotification::getMessage('Penugasan telah berhasil dihapus dari sistem. 👋', 'Data penugasan telah berhasil dihapus dari sistem.')
CheerfulNotification::getByKey('cooperation.assignment_deleted'),
CheerfulNotification::getByKey('cooperation.assignment_deleted_desc')
)
),
])
@ -97,13 +97,13 @@ public function table(Table $table): Table
BulkActionGroup::make([
DeleteBulkAction::make()
->successNotification(fn () => CheerfulNotification::success(
CheerfulNotification::getMessage('Banyak Penugasan Dihapus! 🗑️👋', 'Penugasan Berhasil Dihapus'),
CheerfulNotification::getMessage('Semua penugasan yang dipilih telah dihapus dari sistem. 🧹', 'Seluruh data penugasan yang dipilih telah berhasil dihapus.')
CheerfulNotification::getByKey('cooperation.assignment_success_dihapus'),
CheerfulNotification::getByKey('cooperation.bulk_assignment_deleted')
)
),
]),
])
->emptyStateIcon(Heroicon::OutlinedArchiveBoxXMark)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada penugasan nih! Mari buat penugasan pertama untuk media. 🚀✨', 'Tidak ada data penugasan yang tersedia.'));
->emptyStateDescription(fn () => CheerfulNotification::getByKey('cooperation.assignment_empty'));
}
}

View File

@ -25,8 +25,8 @@ public static function configure(Schema $schema): Schema
{
return $schema
->components([
Section::make(fn () => CheerfulNotification::getMessage('Detail Kerja Sama 🤝', 'Detail Kerja Sama'))
->description(fn () => CheerfulNotification::getMessage('Ayo lengkapi informasi mengenai judul, durasi, dan media yang diajak kerja sama! 🤝✨', 'Lengkapi informasi mengenai judul, durasi, dan media yang terlibat.'))
Section::make(fn () => CheerfulNotification::getByKey('cooperation.detail_title'))
->description(fn () => CheerfulNotification::getByKey('cooperation.detail_desc'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-hand-raised' : null)
->schema([
TextInput::make('title')
@ -88,8 +88,8 @@ public static function configure(Schema $schema): Schema
])
->columnSpan(2),
Section::make(fn () => CheerfulNotification::getMessage('Lampiran & Media 🖼️', 'Lampiran & Media'))
->description(fn () => CheerfulNotification::getMessage('Jangan lupa unggah banner promosi dan template pengajuannya ya! 🖼️✨', 'Unggah banner promosi dan template untuk pengajuan.'))
Section::make(fn () => CheerfulNotification::getByKey('cooperation.attachment_title'))
->description(fn () => CheerfulNotification::getByKey('cooperation.attachment_desc'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-paper-clip' : null)
->schema([
SpatieMediaLibraryFileUpload::make('banner')

View File

@ -287,7 +287,7 @@ public static function configure(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedHandRaised)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data kerja sama nih. Yuk, mulai buat data pertama Anda! 🤝✨', 'Belum ada data kerja sama yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('cooperation.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -24,8 +24,8 @@ protected function setUp(): void
->icon(Heroicon::OutlinedCheck)
->color('success')
->requiresConfirmation()
->modalHeading(fn () => CheerfulNotification::getMessage('Setujui Perubahan Data? ✅✨', 'Setujui Perubahan Data'))
->modalDescription(fn () => CheerfulNotification::getMessage('Siap untuk menerapkan perubahan data ini secara otomatis ke sistem? Pastikan semuanya sudah sesuai ya! 🚀😊', 'Apakah Anda yakin ingin menerapkan perubahan data ini ke dalam sistem?'))
->modalHeading(fn () => CheerfulNotification::getByKey('data_change.approve_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('data_change.approve_desc'))
->action(function (DataChangeRequest $record): void {
$entity = $record->entity;
$newData = $record->new_data;
@ -42,14 +42,14 @@ protected function setUp(): void
]);
CheerfulNotification::success(
CheerfulNotification::getMessage('Penghapusan Disetujui! ✅', 'Penghapusan Disetujui'),
CheerfulNotification::getMessage('Data telah berhasil dihapus sesuai dengan permohonan.', 'Data telah berhasil dihapus sesuai dengan permintaan permohonan.')
CheerfulNotification::getByKey('data_change.deletion_approved'),
CheerfulNotification::getByKey('data_change.deletion_success_desc')
)->send();
// Notify User
$record->user?->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Permohonan Penghapusan Disetujui ✨', 'Permohonan Penghapusan Disetujui'),
'body' => CheerfulNotification::getMessage("Halo! Permohonan penghapusan data Anda untuk {$record->change_reason} telah disetujui oleh admin. 🚀", "Permohonan penghapusan data untuk {$record->change_reason} telah disetujui oleh Admin."),
'title' => CheerfulNotification::getByKey('data_change.deletion_request_approved'),
'body' => CheerfulNotification::getByKey('data_change.deletion_request_title_untuk_telah', ['record__change_reason' => $record->change_reason]),
]));
return;
@ -147,14 +147,14 @@ protected function setUp(): void
]);
CheerfulNotification::success(
CheerfulNotification::getMessage('Perubahan Disetujui! ✅', 'Perubahan Disetujui'),
CheerfulNotification::getMessage('Data telah berhasil diperbarui sesuai dengan permohonan.', 'Data telah berhasil diperbarui sesuai dengan permintaan permohonan.')
CheerfulNotification::getByKey('data_change.change_approved'),
CheerfulNotification::getByKey('data_change.change_success_desc')
)->send();
// Notify User
$record->user?->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Permohonan Perubahan Disetujui ✨', 'Permohonan Perubahan Disetujui'),
'body' => CheerfulNotification::getMessage("Halo! Permohonan perubahan data Anda untuk {$record->change_reason} telah disetujui oleh admin. Cek sekarang ya! 🚀", "Permohonan perubahan data untuk {$record->change_reason} telah disetujui oleh Admin."),
'title' => CheerfulNotification::getByKey('data_change.change_request_approved'),
'body' => CheerfulNotification::getByKey('notification.data_change_approved', ['record__change_reason' => $record->change_reason]),
]));
})
->visible(fn (DataChangeRequest $record): bool => $record->status === DataChangeStatus::PENDING && ! auth()->user()->hasRole(RoleEnum::PERUSAHAAN->value));

View File

@ -29,8 +29,8 @@ protected function setUp(): void
->placeholder('Berikan alasan mengapa permohonan ini ditolak...')
->required(),
])
->modalHeading(fn () => CheerfulNotification::getMessage('Tolak Perubahan Data? 🛑🤔', 'Tolak Perubahan Data'))
->modalDescription(fn () => CheerfulNotification::getMessage('Yakin ingin menolak permohonan ini? Pastikan alasannya jelas biar pemohon nggak bingung ya! 😔📝', 'Apakah Anda yakin ingin menolak permohonan perubahan data ini?'))
->modalHeading(fn () => CheerfulNotification::getByKey('data_change.reject_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('cooperation.reject_proposal_desc'))
->action(function (DataChangeRequest $record, array $data): void {
$record->update([
'status' => DataChangeStatus::REJECTED,
@ -50,14 +50,14 @@ protected function setUp(): void
}
CheerfulNotification::info(
CheerfulNotification::getMessage('Permohonan Ditolak 🛑', 'Permohonan Ditolak'),
CheerfulNotification::getMessage('Permohonan perubahan data telah ditolak. 😔', 'Permohonan perubahan data telah ditolak oleh Admin.')
CheerfulNotification::getByKey('data_change.request_rejected'),
CheerfulNotification::getByKey('data_change.request_rejected_desc')
)->send();
// Notify User
$record->user?->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Permohonan Perubahan Ditolak 🛑', 'Permohonan Perubahan Ditolak'),
'body' => CheerfulNotification::getMessage("Halo! Mohon maaf, permohonan perubahan data Anda untuk {$record->change_reason} ditolak oleh admin. Alasan: {$data['rejection_reason']} 😔", "Permohonan perubahan data Anda untuk {$record->change_reason} telah ditolak oleh Admin.\n\nAlasan: {$data['rejection_reason']}"),
'title' => CheerfulNotification::getByKey('data_change.change_request_rejected'),
'body' => CheerfulNotification::getByKey('notification.data_change_rejected', ['record__change_reason' => $record->change_reason, 'data__rejection_reason' => $data['rejection_reason']]),
]));
})
->visible(fn (DataChangeRequest $record): bool => $record->status === DataChangeStatus::PENDING && ! auth()->user()->hasRole(RoleEnum::PERUSAHAAN->value))

View File

@ -120,8 +120,8 @@ public static function infolist(Schema $schema): Schema
if (isset($new['__delete_request__']) && $new['__delete_request__'] === true) {
return "
<div style='background-color:#fee2e2; border:1px solid #f87171; color:#991b1b; padding:16px; border-radius:8px; margin-bottom:16px;'>
<div style='font-weight:700; font-size:1.125rem; margin-bottom:4px;'>".CheerfulNotification::getMessage('🚮 Permohonan Penghapusan Data', 'Permohonan Penghapusan Data')."</div>
<p style='font-size:0.875rem;'>".CheerfulNotification::getMessage('User mengajukan penghapusan permanen untuk data ini. Semua informasi terkait akan dihapus setelah disetujui.', 'Pengguna mengajukan permohonan penghapusan permanen untuk data ini.').'</p>
<div style='font-weight:700; font-size:1.125rem; margin-bottom:4px;'>".CheerfulNotification::getByKey('data_change.deletion_request_title')."</div>
<p style='font-size:0.875rem;'>".CheerfulNotification::getByKey('data_change.deletion_request_desc').'</p>
</div>
';
}
@ -144,8 +144,8 @@ public static function infolist(Schema $schema): Schema
return "
<div style='background-color:#f0fdf4; border:1px solid #bbf7d0; color:#166534; padding:16px; border-radius:8px; margin-bottom:16px;'>
<div style='font-weight:700; font-size:1.125rem; margin-bottom:4px;'>".CheerfulNotification::getMessage('✨ Permohonan Penambahan Data', 'Permohonan Penambahan Data')."</div>
<p style='font-size:0.875rem;'>".CheerfulNotification::getMessage('Berikut adalah data baru yang akan dibuat.', 'Berikut adalah rincian data baru yang diajukan.')."</p>
<div style='font-weight:700; font-size:1.125rem; margin-bottom:4px;'>".CheerfulNotification::getByKey('data_change.addition_request_title')."</div>
<p style='font-size:0.875rem;'>".CheerfulNotification::getByKey('data_change.addition_request_desc')."</p>
</div>
{$rows}
";
@ -205,9 +205,9 @@ public static function table(Table $table): Table
->searchable()
->sortable()
->description(fn (DataChangeRequest $record): ?string => match (true) {
isset($record->new_data['__delete_request__']) => CheerfulNotification::getMessage('🗑️ Penghapusan', 'Penghapusan'),
empty($record->old_data) => CheerfulNotification::getMessage('✨ Penambahan', 'Penambahan'),
default => CheerfulNotification::getMessage('📝 Perubahan', 'Perubahan'),
isset($record->new_data['__delete_request__']) => CheerfulNotification::getByKey('data_change.deletion'),
empty($record->old_data) => CheerfulNotification::getByKey('data_change.addition'),
default => CheerfulNotification::getByKey('data_change.change'),
})
->formatStateUsing(fn (DataChangeRequest $record): ?string => match ($record->entity_type) {
Company::class => 'Perusahaan',
@ -268,7 +268,7 @@ public static function table(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedDocumentText)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada permohonan baru nih! Semua aman dan terkendali. ✨✅', 'Belum ada permohonan perubahan data yang tersedia.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('data_change.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -21,8 +21,8 @@ protected function setUp(): void
parent::setUp();
$this->label('Tambah')
->modalHeading(fn () => CheerfulNotification::getMessage('Tambah Jurnalis Baru 🚀✨', 'Tambah Jurnalis'))
->modalDescription(fn () => CheerfulNotification::getMessage('Yuk, masukkan data jurnalisnya dengan lengkap biar sistem makin mantap! 💪😊', 'Silakan masukkan detail data jurnalis baru di bawah ini.'))
->modalHeading(fn () => CheerfulNotification::getByKey('journalist.create_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('journalist.create_desc'))
->modalSubmitActionLabel('Simpan')
->modalCancelActionLabel('Batal')
->successNotification(null)
@ -94,16 +94,16 @@ protected function setUp(): void
]);
CheerfulNotification::success(
CheerfulNotification::getMessage('Permohonan Berhasil 🎉', 'Permohonan Berhasil'),
CheerfulNotification::getMessage('Data jurnalis baru telah dikirim dan sedang menunggu verifikasi admin ⏳', 'Permohonan penambahan jurnalis baru sedang menunggu verifikasi.')
CheerfulNotification::getByKey('journalist.request_success'),
CheerfulNotification::getByKey('journalist.addition_request_processing')
)->send();
User::superAdmin()
->get()
->each(function ($admin) use ($dataChangeRequest, $user): void {
$admin->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Ada Penambahan Jurnalis Baru ✨', 'Penambahan Jurnalis Baru'),
'body' => CheerfulNotification::getMessage('Halooo Admin! 👋 '.$user->name.' baru saja menambahkan jurnalis baru. Yuk, cek detailnya! 🚀', 'Pengguna '.$user->name.' telah menambahkan jurnalis baru ke dalam sistem.'),
'title' => CheerfulNotification::getByKey('data_change.addition_jurnalis_baru'),
'body' => CheerfulNotification::getByKey('notification.user_added_journalist', ['user__name' => $user->name]),
'action' => [
Action::make('view')
->label('Lihat')

View File

@ -24,8 +24,8 @@ protected function setUp(): void
$this->successNotification(null);
$this->modalHeading(fn () => auth()->user()->company?->verificationRequest?->status === VerificationStatus::APPROVED
? CheerfulNotification::getMessage('Mau Ajukan Penghapusan Jurnalis? 🗑️📬', 'Ajukan Penghapusan Jurnalis')
: CheerfulNotification::getMessage('Betulan Mau Hapus Jurnalis? 🗑️🤔', 'Hapus Jurnalis')
? CheerfulNotification::getByKey('journalist.request_deletion_title')
: CheerfulNotification::getByKey('journalist.delete_title')
);
$this->schema(fn () => auth()->user()->company?->verificationRequest?->status === VerificationStatus::APPROVED ? [
@ -46,8 +46,8 @@ protected function setUp(): void
if ($existingRequest) {
CheerfulNotification::warning(
CheerfulNotification::getMessage('Pengajuan Sudah Ada ⏳', 'Pengajuan Sedang Diproses'),
CheerfulNotification::getMessage('Masih ada pengajuan penghapusan jurnalis yang sedang menunggu verifikasi.', 'Pengajuan penghapusan jurnalis ini masih dalam proses verifikasi admin.')
CheerfulNotification::getByKey('journalist.request_processing'),
CheerfulNotification::getByKey('journalist.deletion_request_processing')
)->send();
return;
@ -63,16 +63,16 @@ protected function setUp(): void
]);
CheerfulNotification::success(
CheerfulNotification::getMessage('Permohonan Berhasil 🎉', 'Permohonan Berhasil'),
CheerfulNotification::getMessage('Permohonan penghapusan jurnalis telah dikirim dan sedang menunggu verifikasi admin ⏳', 'Pengajuan penghapusan jurnalis telah berhasil dikirim.')
CheerfulNotification::getByKey('journalist.request_success'),
CheerfulNotification::getByKey('journalist.deletion_request_success')
)->send();
User::superAdmin()
->get()
->each(function ($admin) use ($user, $record, $dataChangeRequest): void {
$admin->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Ada Pengajuan Penghapusan Jurnalis ✨', 'Pengajuan Penghapusan Jurnalis'),
'body' => CheerfulNotification::getMessage('Halooo Admin! 👋 '.$user->name.' baru saja mengajukan penghapusan jurnalis '.$record->name.'. Yuk, cek detailnya! 🚀', 'Pengguna '.$user->name.' telah mengajukan penghapusan jurnalis '.$record->name.'.'),
'title' => CheerfulNotification::getByKey('journalist.deletion_request_notif'),
'body' => CheerfulNotification::getByKey('notification.user_submitted_journalist_change', ['user__name' => $user->name, 'record__name' => $record->name]),
'action' => [
Action::make('view')
->label('Lihat')

View File

@ -22,8 +22,8 @@ protected function setUp(): void
{
parent::setUp();
$this->modalHeading(fn () => CheerfulNotification::getMessage('Sempurnakan Data Jurnalis 📝✨', 'Ubah Data Jurnalis'))
->modalDescription(fn () => CheerfulNotification::getMessage('Ayo kita perbarui supaya data jurnalis makin akurat dan segar lagi! 🛠️👌', 'Silakan perbarui informasi jurnalis pada formulir di bawah ini.'))
$this->modalHeading(fn () => CheerfulNotification::getByKey('journalist.edit_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('journalist.edit_desc'))
->modalWidth(Width::Large)
->successNotification(null)
->fillForm(function (Journalist $journalist): array {
@ -61,8 +61,8 @@ protected function setUp(): void
if ($existingRequest) {
CheerfulNotification::warning(
CheerfulNotification::getMessage('Pengajuan Sudah Ada ⏳', 'Pengajuan Sedang Diproses'),
CheerfulNotification::getMessage('Masih ada pengajuan perubahan data yang sedang menunggu verifikasi.', 'Pengajuan perubahan data ini masih dalam proses verifikasi admin.')
CheerfulNotification::getByKey('journalist.request_processing'),
CheerfulNotification::getByKey('journalist.request_processing_desc')
)->send();
return $record;
@ -121,8 +121,8 @@ protected function setUp(): void
if (empty($changedFields)) {
CheerfulNotification::info(
CheerfulNotification::getMessage('Belum ada yang berubah ✨', 'Tidak Ada Perubahan'),
CheerfulNotification::getMessage('Ubah data terlebih dulu lalu simpan kembali 💪', 'Silakan ubah data terlebih dahulu sebelum menyimpan.')
CheerfulNotification::getByKey('journalist.no_change'),
CheerfulNotification::getByKey('journalist.no_change_desc')
)->send();
return $record;
@ -138,16 +138,16 @@ protected function setUp(): void
]);
CheerfulNotification::success(
CheerfulNotification::getMessage('Permohonan Berhasil 🎉', 'Permohonan Berhasil'),
CheerfulNotification::getMessage('Data sudah dikirim dan sedang menunggu verifikasi admin ⏳', 'Pengajuan perubahan data telah berhasil dikirim.')
CheerfulNotification::getByKey('journalist.request_success'),
CheerfulNotification::getByKey('journalist.request_success_desc')
)->send();
User::superAdmin()
->get()
->each(function ($admin) use ($dataChangeRequest, $user): void {
$admin->notify(new BroadcastNotification([
'title' => CheerfulNotification::getMessage('Ada Pengajuan Perubahan Jurnalis ✨', 'Pengajuan Perubahan Jurnalis'),
'body' => CheerfulNotification::getMessage('Halooo Admin! 👋 '.$user->name.' baru saja mengajukan perubahan data jurnalis. Yuk, cek detailnya! 🚀', 'Pengguna '.$user->name.' telah mengajukan perubahan data jurnalis.'),
'title' => CheerfulNotification::getByKey('journalist.change_request_title'),
'body' => CheerfulNotification::getByKey('notification.user_submitted_journalist_change', ['user__name' => $user->name]),
'action' => [
Action::make('view')
->label('Lihat')

View File

@ -207,15 +207,15 @@ public static function table(Table $table): Table
])->visible(fn () => ! (in_array(auth()->user()->company?->verificationRequest?->status, [VerificationStatus::PENDING, VerificationStatus::REJECTED]) || auth()->user()->company?->verificationRequest()->pending()->exists())),
])
->emptyStateIcon(Heroicon::OutlinedIdentification)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data Jurnalis nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data Jurnalis yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('journalist.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])
->deferLoading()
->when(fn () => auth()->user()->hasRole(RoleEnum::PERUSAHAAN->value) && ! auth()->user()->company?->partnerMedia, function (Table $table): Table {
return $table
->emptyStateHeading(fn () => CheerfulNotification::getMessage('Wah, Pintunya Dikunci Nih! 🔒✨', 'Akses Dibatasi'))
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Ups! Silakan lengkapi data media Anda dulu ya sebelum mengelola jurnalis. ✨📝', 'Silakan lengkapi data media Anda terlebih dahulu untuk dapat mengelola informasi jurnalis.'))
->emptyStateHeading(fn () => CheerfulNotification::getByKey('access.restricted'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('access.complete_media_data'))
->emptyStateIcon(Heroicon::OutlinedLockClosed)
->emptyStateActions([
Action::make('complete_media')

View File

@ -54,8 +54,8 @@ public static function infolist(Schema $schema): Schema
{
return $schema
->schema([
Section::make(fn () => CheerfulNotification::getMessage('Akun 👤', 'Akun'))
->description(fn () => CheerfulNotification::getMessage('Detail informasi akun pengguna yang terdaftar. ✨', 'Informasi detail mengenai akun pengguna.'))
Section::make(fn () => CheerfulNotification::getByKey('company.account_title'))
->description(fn () => CheerfulNotification::getByKey('company.account_desc'))
->schema([
Grid::make(3)
->schema([
@ -79,8 +79,8 @@ public static function infolist(Schema $schema): Schema
]),
]),
Section::make(fn () => CheerfulNotification::getMessage('Perusahaan 🏢', 'Perusahaan'))
->description(fn () => CheerfulNotification::getMessage('Informasi lengkap mengenai profil dan legalitas perusahaan. 🏢✨', 'Informasi detail mengenai profil dan legalitas perusahaan.'))
Section::make(fn () => CheerfulNotification::getByKey('company.company_title'))
->description(fn () => CheerfulNotification::getByKey('company.company_desc'))
->schema([
Grid::make(3)
->schema([
@ -122,7 +122,7 @@ public static function infolist(Schema $schema): Schema
Grid::make(3)
->schema([
Section::make(fn () => CheerfulNotification::getMessage('NIK Direktur 👤✨', 'NIK Direktur'))
Section::make(fn () => CheerfulNotification::getByKey('company.director_nik'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-user' : null)
->schema([
TextEntry::make('company.director_nik')
@ -157,7 +157,7 @@ public static function infolist(Schema $schema): Schema
}),
]),
Section::make(fn () => CheerfulNotification::getMessage('Akta Pendirian 📄✨', 'Akta Pendirian'))
Section::make(fn () => CheerfulNotification::getByKey('company.establishment_deed'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null)
->schema([
TextEntry::make('company.deed_incorporation')
@ -166,7 +166,7 @@ public static function infolist(Schema $schema): Schema
self::fileEntry('company.deed_incorporation'),
]),
Section::make(fn () => CheerfulNotification::getMessage('SIUP / NIB 📄✨', 'SIUP / NIB'))
Section::make(fn () => CheerfulNotification::getByKey('company.siup_nib'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null)
->schema([
TextEntry::make('company.trade_license')
@ -175,7 +175,7 @@ public static function infolist(Schema $schema): Schema
self::fileEntry('company.trade_license'),
]),
Section::make(fn () => CheerfulNotification::getMessage('NPWP 📄✨', 'NPWP'))
Section::make(fn () => CheerfulNotification::getByKey('company.npwp'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null)
->schema([
TextEntry::make('company.tax_id_number')
@ -184,7 +184,7 @@ public static function infolist(Schema $schema): Schema
self::fileEntry('company.tax_id_number'),
]),
Section::make(fn () => CheerfulNotification::getMessage('PKP 📄✨', 'PKP'))
Section::make(fn () => CheerfulNotification::getByKey('company.pkp'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null)
->schema([
TextEntry::make('company.taxable_enterprise')
@ -193,7 +193,7 @@ public static function infolist(Schema $schema): Schema
self::fileEntry('company.taxable_enterprise'),
]),
Section::make(fn () => CheerfulNotification::getMessage('SPT Tahunan 📄✨', 'SPT Tahunan'))
Section::make(fn () => CheerfulNotification::getByKey('company.annual_tax'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null)
->schema([
TextEntry::make('company.annual_tax_return')
@ -202,7 +202,7 @@ public static function infolist(Schema $schema): Schema
self::fileEntry('company.annual_tax_return'),
]),
Section::make(fn () => CheerfulNotification::getMessage('SK Domisili 📄✨', 'SK Domisili'))
Section::make(fn () => CheerfulNotification::getByKey('company.domicile'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null)
->schema([
TextEntry::make('company.domicile_certificate')
@ -211,7 +211,7 @@ public static function infolist(Schema $schema): Schema
self::fileEntry('company.domicile_certificate'),
]),
Section::make(fn () => CheerfulNotification::getMessage('Profil Perusahaan 📄✨', 'Profil Perusahaan'))
Section::make(fn () => CheerfulNotification::getByKey('company.company_profile'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null)
->schema([
TextEntry::make('company.profile')
@ -222,8 +222,8 @@ public static function infolist(Schema $schema): Schema
]),
]),
Section::make(fn () => CheerfulNotification::getMessage('Media 📺', 'Media'))
->description(fn () => CheerfulNotification::getMessage('Detail informasi media yang dikelola oleh perusahaan ini. 📺✨', 'Informasi detail mengenai media yang dikelola.'))
Section::make(fn () => CheerfulNotification::getByKey('company.media_title'))
->description(fn () => CheerfulNotification::getByKey('company.media_desc'))
->schema([
Grid::make(4)
->schema([
@ -249,7 +249,7 @@ public static function infolist(Schema $schema): Schema
Grid::make(2)
->schema([
Section::make(fn () => CheerfulNotification::getMessage('Sertifikat Organisasi Kewartawanan 📄✨', 'Sertifikat Organisasi Kewartawanan'))
Section::make(fn () => CheerfulNotification::getByKey('company.journalism_org_cert'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null)
->schema([
TextEntry::make('company.partnerMedia.journalism_organization')
@ -258,7 +258,7 @@ public static function infolist(Schema $schema): Schema
self::fileEntry('company.partnerMedia.journalism_organization', 'company.partnerMedia', 'partnerMedia'),
]),
Section::make(fn () => CheerfulNotification::getMessage('Sertifikat Dewan Pers 📄✨', 'Sertifikat Dewan Pers'))
Section::make(fn () => CheerfulNotification::getByKey('company.press_council_cert'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null)
->schema([
TextEntry::make('company.partnerMedia.press_council_certificate')
@ -269,8 +269,8 @@ public static function infolist(Schema $schema): Schema
]),
]),
Section::make(fn () => CheerfulNotification::getMessage('Jurnalis ✍️', 'Jurnalis'))
->description(fn () => CheerfulNotification::getMessage('Daftar jurnalis yang terdaftar di bawah bendera media ini. ✍️✨', 'Daftar jurnalis yang terdaftar pada media ini.'))
Section::make(fn () => CheerfulNotification::getByKey('company.journalist_title'))
->description(fn () => CheerfulNotification::getByKey('company.journalist_desc'))
->schema([
RepeatableEntry::make('company.partnerMedia.journalists')
->hiddenLabel()
@ -288,7 +288,7 @@ public static function infolist(Schema $schema): Schema
]),
Grid::make(2)
->schema([
Section::make(fn () => CheerfulNotification::getMessage('Kartu Pers 🆔✨', 'Kartu Pers'))
Section::make(fn () => CheerfulNotification::getByKey('company.press_card'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-identification' : null)
->schema([
TextEntry::make('press_card')
@ -297,7 +297,7 @@ public static function infolist(Schema $schema): Schema
self::fileEntry('press_card', null, 'journalists'),
]),
Section::make(fn () => CheerfulNotification::getMessage('Sertifikat UKW 📄✨', 'Sertifikat UKW'))
Section::make(fn () => CheerfulNotification::getByKey('company.ukw_cert'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null)
->schema([
TextEntry::make('ukw_certificate')
@ -415,7 +415,7 @@ public static function table(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedBuildingOffice2)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada rekanan yang terdaftar nih. Yuk, ajak mereka bergabung dengan aplikasi kita! 🏢✨', 'Belum ada data rekanan yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('company.partner_empty'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -111,7 +111,7 @@ public static function table(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedListBullet)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data Kategori nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data Kategori yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('category.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -19,8 +19,8 @@ protected function getHeaderActions(): array
return [
CreateAction::make()
->label('Tambah')
->modalHeading(fn () => CheerfulNotification::getMessage('Tambah Kategori Baru 🏷️✨', 'Tambah Kategori'))
->modalDescription(fn () => CheerfulNotification::getMessage('Tambahkan kategori baru biar data makin teratur dan rapi! 📁😊', 'Silakan masukkan detail kategori data di bawah ini.'))
->modalHeading(fn () => CheerfulNotification::getByKey('category.create_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('category.create_desc'))
->modalSubmitActionLabel('Simpan')
->modalCancelActionLabel('Batal')
->extraModalFooterActions(fn (CreateAction $action): array => [

View File

@ -111,7 +111,7 @@ public static function table(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedBookOpen)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data Klasifikasi nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data Klasifikasi yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('classification.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -19,8 +19,8 @@ protected function getHeaderActions(): array
return [
CreateAction::make()
->label('Tambah')
->modalHeading(fn () => CheerfulNotification::getMessage('Tambah Klasifikasi Baru 📂✨', 'Tambah Klasifikasi'))
->modalDescription(fn () => CheerfulNotification::getMessage('Bantu sistem mengelompokkan data dengan klasifikasi yang pas! 🧩😊', 'Silakan masukkan detail klasifikasi data di bawah ini.'))
->modalHeading(fn () => CheerfulNotification::getByKey('classification.create_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('classification.create_desc'))
->modalSubmitActionLabel('Simpan')
->modalCancelActionLabel('Batal')
->extraModalFooterActions(fn (CreateAction $action): array => [

View File

@ -122,7 +122,7 @@ public static function table(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedBuildingLibrary)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data OPD nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data OPD yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('opd.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -19,8 +19,8 @@ protected function getHeaderActions(): array
return [
CreateAction::make()
->label('Tambah')
->modalHeading(fn () => CheerfulNotification::getMessage('Tambah OPD Baru 🏢✨', 'Tambah OPD'))
->modalDescription(fn () => CheerfulNotification::getMessage('Daftarkan instansi/OPD baru ke dalam sistem kita! 💪😊', 'Silakan masukkan detail instansi/OPD baru di bawah ini.'))
->modalHeading(fn () => CheerfulNotification::getByKey('opd.create_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('opd.create_desc'))
->modalSubmitActionLabel('Simpan')
->modalCancelActionLabel('Batal')
->extraModalFooterActions(fn (CreateAction $action): array => [

View File

@ -111,7 +111,7 @@ public static function table(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedMapPin)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data Lokus nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data Lokus yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('locus.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -19,8 +19,8 @@ protected function getHeaderActions(): array
return [
CreateAction::make()
->label('Tambah')
->modalHeading(fn () => CheerfulNotification::getMessage('Tambah Lokus Baru 📍✨', 'Tambah Lokus'))
->modalDescription(fn () => CheerfulNotification::getMessage('Tentukan titik lokasi baru biar datanya makin presisi! 🗺️😊', 'Silakan masukkan detail lokasi/lokus data di bawah ini.'))
->modalHeading(fn () => CheerfulNotification::getByKey('locus.create_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('locus.create_desc'))
->modalSubmitActionLabel('Simpan')
->modalCancelActionLabel('Batal')
->extraModalFooterActions(fn (CreateAction $action): array => [

View File

@ -19,8 +19,8 @@ protected function getHeaderActions(): array
return [
CreateAction::make()
->label('Tambah')
->modalHeading(fn () => CheerfulNotification::getMessage('Tambah Subklasifikasi Baru 📑✨', 'Tambah Subklasifikasi'))
->modalDescription(fn () => CheerfulNotification::getMessage('Perdalam klasifikasi data biar makin detail dan tertata! 🗂️😊', 'Silakan masukkan detail subklasifikasi data di bawah ini.'))
->modalHeading(fn () => CheerfulNotification::getByKey('classification.sub.create_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('classification.sub.create_desc'))
->modalSubmitActionLabel('Simpan')
->modalCancelActionLabel('Batal')
->extraModalFooterActions(fn (CreateAction $action): array => [

View File

@ -92,8 +92,8 @@ public static function table(Table $table): Table
$record->save();
CheerfulNotification::success(
CheerfulNotification::getMessage('Status Berubah! 🔄✨', 'Status Diperbarui'),
CheerfulNotification::getMessage('Status data berhasil diperbarui. Perubahan langsung aktif ya! 👍', 'Perubahan status data telah berhasil disimpan dan diterapkan.')
CheerfulNotification::getByKey('status.updated'),
CheerfulNotification::getByKey('status.update_success')
)->send();
}),
@ -132,7 +132,7 @@ public static function table(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedQueueList)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data Subklasifikasi nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('user.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -19,8 +19,8 @@ protected function getHeaderActions(): array
return [
CreateAction::make()
->label('Tambah')
->modalHeading(fn () => CheerfulNotification::getMessage('Tambah Sublokus Baru 📌✨', 'Tambah Sublokus'))
->modalDescription(fn () => CheerfulNotification::getMessage('Detailkan lebih dalam lagi titik lokasinya, ya! 📍😊', 'Silakan masukkan detail sublokus data di bawah ini.'))
->modalHeading(fn () => CheerfulNotification::getByKey('locus.sub.create_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('locus.sub.create_desc'))
->modalSubmitActionLabel('Simpan')
->modalCancelActionLabel('Batal')
->extraModalFooterActions(fn (CreateAction $action): array => [

View File

@ -129,7 +129,7 @@ public static function table(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedNumberedList)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data Sublokus nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data Sublokus yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('locus.sub.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -19,8 +19,8 @@ protected function getHeaderActions(): array
return [
CreateAction::make()
->label('Tambah')
->modalHeading(fn () => CheerfulNotification::getMessage('Tambah Tema Baru 📂✨', 'Tambah Tema'))
->modalDescription(fn () => CheerfulNotification::getMessage('Ayo tambahkan tema biar pengelompokan makin lengkap! 📚😊', 'Silakan masukkan detail tema data di bawah ini.'))
->modalHeading(fn () => CheerfulNotification::getByKey('theme.create_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('theme.create_desc'))
->modalSubmitActionLabel('Simpan')
->modalCancelActionLabel('Batal')
->extraModalFooterActions(fn (CreateAction $action): array => [

View File

@ -105,7 +105,7 @@ public static function table(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedPuzzlePiece)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data Tema nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data Tema yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('theme.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -19,8 +19,8 @@ protected function getHeaderActions(): array
return [
CreateAction::make()
->label('Tambah')
->modalHeading(fn () => CheerfulNotification::getMessage('Tambah Pengguna Baru 🚀✨', 'Tambah Pengguna'))
->modalDescription(fn () => CheerfulNotification::getMessage('Yuk, buat akun baru biar makin lengkap penggunanya! 💪😊', 'Silakan masukkan detail akun pengguna baru di bawah ini.'))
->modalHeading(fn () => CheerfulNotification::getByKey('user.create_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('user.create_desc'))
->modalSubmitActionLabel('Simpan')
->modalCancelActionLabel('Batal')
->extraModalFooterActions(fn (CreateAction $action): array => [

View File

@ -140,8 +140,8 @@ public static function table(Table $table): Table
}
CheerfulNotification::success(
$state ? CheerfulNotification::getMessage('Pengguna Diaktifkan! ✅', 'Pengguna Diaktifkan') : CheerfulNotification::getMessage('Pengguna Dinonaktifkan ⛔', 'Pengguna Dinonaktifkan'),
$state ? CheerfulNotification::getMessage('Status akun pengguna berhasil diaktifkan kembali. Siap beraksi! 🚀', 'Status akun pengguna telah berhasil diaktifkan kembali.') : CheerfulNotification::getMessage('Status akun pengguna berhasil dinonaktifkan. Istirahat dulu ya... 😴', 'Status akun pengguna telah berhasil dinonaktifkan.')
$state ? CheerfulNotification::getByKey('user.activated') : CheerfulNotification::getByKey('user.deactivated'),
$state ? CheerfulNotification::getByKey('user.status_activated_success') : CheerfulNotification::getByKey('user.status_activated_success')
)->send();
})
->disabled(fn (User $record): bool => $record->hasRole(RoleEnum::PERUSAHAAN->value)),
@ -192,7 +192,7 @@ public static function table(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedUserGroup)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data pengguna nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('user.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -22,8 +22,8 @@ public static function configure(Schema $schema): Schema
{
return $schema
->components([
Section::make(fn () => CheerfulNotification::getMessage('Informasi Konten 📝', 'Informasi Konten'))
->description(fn () => CheerfulNotification::getMessage('Lengkapi detail judul, tautan, dan jenis konten Anda biar makin keren! 🚀😊', 'Lengkapi detail judul, tautan, dan jenis konten Anda.'))
Section::make(fn () => CheerfulNotification::getByKey('content.section_title'))
->description(fn () => CheerfulNotification::getByKey('content.section_desc'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-document-text' : null)
->schema([
TextInput::make('title')
@ -74,8 +74,8 @@ public static function configure(Schema $schema): Schema
]),
])->columnSpan(2),
Section::make(fn () => CheerfulNotification::getMessage('Klasifikasi & Lampiran 📁', 'Klasifikasi & Lampiran'))
->description(fn () => CheerfulNotification::getMessage('Pilih klasifikasi yang pas dan unggah gambar pendukung ya! 📁✨', 'Pilih klasifikasi yang sesuai dan unggah gambar pendukung.'))
Section::make(fn () => CheerfulNotification::getByKey('content.attachment_title'))
->description(fn () => CheerfulNotification::getByKey('content.attachment_desc'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-folder-open' : null)
->schema([
Select::make('classification_id')

View File

@ -201,7 +201,7 @@ public static function configure(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedClipboardDocumentList)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data Rekap Konten nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data Rekap Konten yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('content.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -20,8 +20,8 @@ public static function configure(Schema $schema): Schema
{
return $schema
->components([
Section::make(fn () => CheerfulNotification::getMessage('Identifikasi Isu 🔍', 'Identifikasi Isu'))
->description(fn () => CheerfulNotification::getMessage('Yuk, hubungkan dengan berita monitoring dan tentukan lokasi isunya! 🔍✨', 'Hubungkan dengan berita monitoring dan tentukan lokasi isu.'))
Section::make(fn () => CheerfulNotification::getByKey('issue.identification_title'))
->description(fn () => CheerfulNotification::getByKey('issue.identification_desc'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-magnifying-glass' : null)
->schema([
Select::make('media_monitoring_id')
@ -73,8 +73,8 @@ public static function configure(Schema $schema): Schema
->columnSpanFull(),
])->columnSpan(2),
Section::make(fn () => CheerfulNotification::getMessage('Sentimen & Klasifikasi 📊', 'Sentimen & Klasifikasi'))
->description(fn () => CheerfulNotification::getMessage('Tentukan sentimen isu, respon, dan kategorinya biar makin jelas! 📊✨', 'Tentukan sentimen isu, respon, dan kategori klasifikasinya.'))
Section::make(fn () => CheerfulNotification::getByKey('issue.sentiment_title'))
->description(fn () => CheerfulNotification::getByKey('issue.sentiment_desc'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-chart-bar' : null)
->schema([
Select::make('issue')

View File

@ -229,7 +229,7 @@ public static function configure(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedExclamationCircle)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data Manajemen Isu nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data Manajemen Isu yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('issue.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -47,13 +47,13 @@ protected function setUp(): void
if ($count > 0) {
CheerfulNotification::success(
CheerfulNotification::getMessage('Crawl Berhasil! 🕸️🚀', 'Crawl Selesai'),
CheerfulNotification::getMessage("Mantap! Ada {$count} berita baru nih tentang '{$data['keyword']}' di Purwakarta. Databasenya makin kaya! 😎", "Berhasil mendapatkan {$count} berita baru terkait kata kunci '{$data['keyword']}'.")
CheerfulNotification::getByKey('crawl.success'),
CheerfulNotification::getByKey('news.content.fetch_success', ['count' => $count, 'data__keyword' => $data['keyword']])
)->send();
} else {
CheerfulNotification::info(
CheerfulNotification::getMessage('Belum Ada Berita Baru 🔍', 'Tidak Ada Berita Baru'),
CheerfulNotification::getMessage("Hmm, sepertinya belum ada update berita baru untuk '{$data['keyword']}'. Coba lagi nanti ya! 😉", "Tidak ditemukan berita baru untuk kata kunci '{$data['keyword']}' saat ini.")
CheerfulNotification::getByKey('news.no_new_data'),
CheerfulNotification::getByKey('news.content.fetch_empty', ['data__keyword' => $data['keyword']])
)->send();
}
})

View File

@ -21,8 +21,8 @@ public static function configure(Schema $schema): Schema
{
return $schema
->components([
Section::make(fn () => CheerfulNotification::getMessage('Detail Berita 📰', 'Detail Berita'))
->description(fn () => CheerfulNotification::getMessage('Masukkan informasi lengkap mengenai pemberitaan media biar makin lengkap! 📰✨', 'Masukkan informasi lengkap mengenai pemberitaan media.'))
Section::make(fn () => CheerfulNotification::getByKey('news.detail_title'))
->description(fn () => CheerfulNotification::getByKey('news.detail_desc'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-newspaper' : null)
->schema([
TextInput::make('media_name')
@ -75,8 +75,8 @@ public static function configure(Schema $schema): Schema
->required(),
])->columnSpan(2),
Section::make(fn () => CheerfulNotification::getMessage('Kategori & Metadata 🏷️', 'Kategori & Metadata'))
->description(fn () => CheerfulNotification::getMessage('Tentukan kategori berita dan informasi tambahan lainnya biar makin rapi! 🏷️✨', 'Tentukan kategori berita dan informasi tambahan lainnya.'))
Section::make(fn () => CheerfulNotification::getByKey('news.category_title'))
->description(fn () => CheerfulNotification::getByKey('news.category_desc'))
->icon(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-tag' : null)
->schema([
Select::make('channel')

View File

@ -214,7 +214,7 @@ public static function configure(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedClipboardDocumentCheck)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data Monitoring Media nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data Monitoring Media yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('news.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -162,7 +162,7 @@ public static function table(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedMegaphone)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data Pengumuman nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data Pengumuman yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('announcement.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -24,8 +24,8 @@ protected function getHeaderActions(): array
return [
CreateAction::make()
->label('Tambah')
->modalHeading(fn () => CheerfulNotification::getMessage('Buat Pengumuman Baru 📢✨', 'Tambah Pengumuman'))
->modalDescription(fn () => CheerfulNotification::getMessage('Siarkan kabar terbaru ke seluruh sistem biar semua orang tetap update! 🚀😊', 'Silakan isi formulir di bawah ini untuk membuat pengumuman baru.'))
->modalHeading(fn () => CheerfulNotification::getByKey('announcement.create_title'))
->modalDescription(fn () => CheerfulNotification::getByKey('announcement.create_desc'))
->modalSubmitActionLabel('Simpan')
->modalCancelActionLabel('Batal')
->extraModalFooterActions(fn (CreateAction $action): array => [

View File

@ -27,8 +27,8 @@ public static function configure(Schema $schema): Schema
Hidden::make('author_id')
->default(auth()->id()),
Section::make(CheerfulNotification::getMessage('Konten Berita ✍️', 'Konten Berita'))
->description(CheerfulNotification::getMessage('Yuk, tuliskan judul, ringkasan, dan isi lengkap berita Anda biar makin menarik! 🚀😊', 'Silakan tuliskan judul, ringkasan, dan isi lengkap berita Anda.'))
Section::make(CheerfulNotification::getByKey('news.content.title'))
->description(CheerfulNotification::getByKey('news.content.desc'))
->icon(CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-pencil-square' : null)
->schema([
TextInput::make('title')
@ -52,8 +52,8 @@ public static function configure(Schema $schema): Schema
->columnSpanFull(),
])->columnSpan(2),
Section::make(CheerfulNotification::getMessage('Kategori & Publikasi 🏷️', 'Kategori & Publikasi'))
->description(CheerfulNotification::getMessage('Tentukan kategori, tautan media, dan status publikasi biar berita kita gampang dicari! 🏷️✨', 'Tentukan kategori, tautan media, dan status publikasi.'))
Section::make(CheerfulNotification::getByKey('news.content.category_title'))
->description(CheerfulNotification::getByKey('news.content.category_desc'))
->icon(CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL ? 'heroicon-o-tag' : null)
->schema([
TextInput::make('link')

View File

@ -115,7 +115,7 @@ public static function configure(Table $table): Table
]),
])
->emptyStateIcon(Heroicon::OutlinedNewspaper)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data Berita nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data Berita yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('news.content.empty_state'))
->defaultSort('created_at', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -168,7 +168,7 @@ public static function table(Table $table): Table
], FiltersLayout::AboveContentCollapsible)
->filtersFormColumns(3)
->emptyStateIcon(Heroicon::OutlinedChartBar)
->emptyStateDescription(fn () => CheerfulNotification::getMessage('Belum ada data Pengunjung nih! Mulai buat data pertama sekarang biar makin rame! 🚀✨', 'Belum ada data Pengunjung yang tersedia saat ini.'))
->emptyStateDescription(fn () => CheerfulNotification::getByKey('visitor.empty_state'))
->defaultSort('date', 'desc')
->deferFilters(false)
->paginated([25, 50, 100, 'all'])

View File

@ -29,91 +29,73 @@ public static function getNotifStyle(): NotifStyle
public static function create(): Notification
{
$cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL;
return self::make()
->title($cheerful ? 'Hore! Data Tersimpan 🎉✨' : 'Data Berhasil Disimpan')
->body($cheerful ? 'Data baru berhasil ditambahkan! Sistem sudah menyimpannya dengan aman. 🚀💪' : 'Data baru telah berhasil ditambahkan ke dalam sistem.')
->title(self::getByKey('create.title'))
->body(self::getByKey('create.body'))
->success();
}
public static function update(): Notification
{
$cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL;
return self::make()
->title($cheerful ? 'Mantap! Data Diperbarui ✅🔥' : 'Perubahan Tersimpan')
->body($cheerful ? 'Perubahan berhasil disimpan! Data sekarang sudah up-to-date dan segar lagi. ✨👌' : 'Perubahan pada data telah berhasil diperbarui dan disimpan.')
->title(self::getByKey('update.title'))
->body(self::getByKey('update.body'))
->success();
}
public static function delete(): Notification
{
$cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL;
return self::make()
->title($cheerful ? 'Oke, Data Dihapus 🗑️👋' : 'Data Dihapus')
->body($cheerful ? 'Data tersebut sudah berhasil dihapus dari sistem. Semuanya bersih dan rapi sekarang! 😊🚮' : 'Data tersebut telah berhasil dihapus dari sistem aplikasi.')
->title(self::getByKey('delete.title'))
->body(self::getByKey('delete.body'))
->success();
}
public static function forceDelete(): Notification
{
$cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL;
return self::make()
->title($cheerful ? 'Selamat Tinggal Selamanya 👋😢' : 'Data Dihapus Permanen')
->body($cheerful ? 'Data telah dihapus permanen dan tidak bisa kembali. Semoga ini keputusan yang tepat! 🚮💨' : 'Data tersebut telah dihapus secara permanen dari sistem.')
->title(self::getByKey('force_delete.title'))
->body(self::getByKey('force_delete.body'))
->success();
}
public static function restore(): Notification
{
$cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL;
return self::make()
->title($cheerful ? 'Welcome Back! Data Pulih ♻️✨' : 'Data Berhasil Dipulihkan')
->body($cheerful ? 'Data berhasil dikembalikan! Hati-hati ya, jangan sampai terhapus lagi. 😉👍' : 'Data yang dihapus sebelumnya telah berhasil dipulihkan ke dalam sistem.')
->title(self::getByKey('restore.title'))
->body(self::getByKey('restore.body'))
->success();
}
public static function statusUpdated(?string $title = null, ?string $body = null): Notification
{
$cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL;
return self::make()
->title($title ?? ($cheerful ? 'Status Berubah! 🔄✨' : 'Status Diperbarui'))
->body($body ?? ($cheerful ? 'Status data berhasil diperbarui. Perubahan langsung aktif ya! 👍' : 'Status data telah berhasil diperbarui dan telah diterapkan.'))
->title($title ?? self::getByKey('status_updated.title'))
->body($body ?? self::getByKey('status_updated.body'))
->success();
}
public static function bulkDelete(): Notification
{
$cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL;
return self::make()
->title($cheerful ? 'Oke, Banyak Data Dihapus 🗑️👋' : 'Data Berhasil Dihapus')
->body($cheerful ? 'Semua data yang dipilih berhasil dihapus. Sistem makin lega deh! 😊' : 'Seluruh data yang dipilih telah berhasil dihapus dari sistem.')
->title(self::getByKey('bulk_delete.title'))
->body(self::getByKey('bulk_delete.body'))
->success();
}
public static function bulkForceDelete(): Notification
{
$cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL;
return self::make()
->title($cheerful ? 'Bye Bye Semua! 👋🔥' : 'Data Dihapus Permanen')
->body($cheerful ? 'Data yang dipilih sudah dihapus permanen. Bersih total! 🧹💨' : 'Data yang dipilih telah berhasil dihapus secara permanen.')
->title(self::getByKey('bulk_force_delete.title'))
->body(self::getByKey('bulk_force_delete.body'))
->success();
}
public static function bulkRestore(): Notification
{
$cheerful = self::getNotifStyle() === NotifStyle::CHEERFUL;
return self::make()
->title($cheerful ? 'Hore! Banyak Data Pulih ♻️🎉' : 'Data Berhasil Dipulihkan')
->body($cheerful ? 'Data-data tersebut sudah kembali aktif. Selamat bekerja kembali! 💪✨' : 'Seluruh data yang dipilih telah berhasil dikembalikan ke posisi semula.')
->title(self::getByKey('bulk_restore.title'))
->body(self::getByKey('bulk_restore.body'))
->success();
}
@ -162,10 +144,16 @@ public static function danger(string $title, string $body): Notification
}
/**
* Get dynamic message based on UX style.
* Get dynamic message based on UX style from language file.
*/
public static function getMessage(string $cheerful, string $formal): string
public static function getByKey(?string $key = null, array $replace = []): string
{
return self::getNotifStyle() === NotifStyle::CHEERFUL ? $cheerful : $formal;
if (! $key) {
return '';
}
$style = self::getNotifStyle()->value;
return __("notif.{$key}.{$style}", $replace);
}
}

View File

@ -143,6 +143,7 @@ public function panel(Panel $panel): Panel
])
->databaseNotifications()
->databaseNotificationsPolling('30s')
->globalSearch(false);
->globalSearch(false)
->spa();
}
}

1511
lang/id/notif.php Normal file

File diff suppressed because it is too large Load Diff