feat: add app and database modules

This commit is contained in:
2026-05-21 16:05:11 +07:00
parent 37b7e783f5
commit fad70d096b
212 changed files with 23901 additions and 0 deletions
@@ -0,0 +1,56 @@
<?php
declare(strict_types=1);
namespace App\Notifications\Auth;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class LegalConsentConfirmation extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(
protected array $consents
) {}
/**
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return ['mail', 'database'];
}
public function toMail(object $notifiable): MailMessage
{
$appName = config('app.name');
$tosVersion = $this->consents['tos'] ?? 1;
$privacyVersion = $this->consents['privacy'] ?? 1;
$signedAt = now()->format('d M Y, H:i T');
return (new MailMessage)
->subject(__(':app — Official Confirmation of Legal Consents and Agreements', ['app' => $appName]))
->greeting(__('Dear :name,', ['name' => $notifiable->name]))
->line(__('Welcome to :app. This communication serves as the official and legally binding confirmation of the agreements executed during your account provisioning process.', ['app' => $appName]))
->line('**'.__('Executed Legal Documents Portfolio').'**')
->line('• '.__('Terms of Use — version :version', ['version' => $tosVersion]))
->line('• '.__('Privacy Policy — version :version', ['version' => $privacyVersion]))
->line(__('Timestamp of Execution: :date.', ['date' => $signedAt]))
->action(__('Access Official Documentation'), route('legal.show', 'privacy'))
->line(__('Please be advised that a cryptographically hashed record of this consent has been securely archived within our immutable audit trail, ensuring strict adherence to regulatory compliance frameworks, notably **UU PDP No. 27/2022**.'))
->line(__('Should you require further clarification regarding your data privacy rights—including formal requests for data portability, rectification, or erasure—please direct your inquiries to our designated Data Protection Officer via return correspondence. Our standard SLA for such requests is 7 business days.'))
->salutation(__('Sincerely,')."\n**".$appName." Legal & Compliance Division**");
}
/**
* @return array<string, mixed>
*/
public function toArray(object $notifiable): array
{
return [];
}
}
@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
namespace App\Notifications\Auth;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Illuminate\Support\Facades\Config;
class ResetPasswordNotification extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(
public string $token
) {}
/**
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return ['mail'];
}
public function toMail(object $notifiable): MailMessage
{
$appName = config('app.name');
$url = url(route('password.reset', [
'token' => $this->token,
'email' => $notifiable->getEmailForPasswordReset(),
], false));
$expireMinutes = Config::get('auth.passwords.'.Config::get('auth.defaults.passwords').'.expire', 60);
return (new MailMessage)
->subject(__('Password Reset Request for :app', ['app' => $appName]))
->greeting(__('Dear :name,', ['name' => $notifiable->name ?? 'Valued Client']))
->line(__('We have received a formal request to reset the password associated with your :app account.', ['app' => $appName]))
->line(__('To authenticate this request and establish a new password, please click the button provided below. In accordance with our security protocols, this authorization link will expire in **:minutes minutes**.', ['minutes' => $expireMinutes]))
->action(__('Authorize Password Reset'), $url)
->line(__('If the button does not work, copy and paste this URL into your browser:'))
->line('`'.$url.'`')
->line(__('If you did not authorize this password reset request, please disregard this communication. Your account security remains intact, and no further action is required on your part.'))
->salutation(__('Sincerely,')."\n**".$appName." Security Operations**");
}
}
@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace App\Notifications\Auth;
use Illuminate\Auth\Notifications\VerifyEmail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class VerifyEmailNotification extends VerifyEmail implements ShouldQueue
{
use Queueable;
protected function buildMailMessage($url): MailMessage
{
$appName = config('app.name');
return (new MailMessage)
->subject(__('Action Required: Secure Account Verification for :app', ['app' => $appName]))
->greeting(__('Dear Valued Client,', ['app' => $appName]))
->line(__('Thank you for registering with :app. To officially finalize your registration and ensure the security of your account, we kindly request that you authenticate your email address.', ['app' => $appName]))
->action(__('Authenticate Account'), $url)
->line(__('Please note that this secure verification link will expire in 60 minutes. Should this request be made in error, or if you did not authorize the creation of this account, please disregard this communication.'))
->salutation(__('Sincerely,')."\n**".$appName." Identity Management**");
}
}