class SendLoanOverdueJob implements ShouldQueue (View source)

Job responsible for sending an overdue loan notification.

This queued job sends an email notifying the user that the loan period has expired. The job is processed asynchronously to prevent delays in the application flow while handling email dispatch.

Traits

Dispatchable
InteractsWithQueue
Queueable
SerializesModels

Properties

protected string $loanId

The unique identifier of the loan, used to fetch the necessary information.

Methods

__construct(string $loanId)

Create a new job instance.

void
handle(EmailService $emailService)

Execute the job to send the overdue loan notification email.

Details

__construct(string $loanId)

Create a new job instance.

Parameters

string $loanId

The ID of the overdue loan. This ID is converted from UUID to binary format for database access.

void handle(EmailService $emailService)

Execute the job to send the overdue loan notification email.

This method fetches the loan data and sends the overdue notification email using the injected email service.

Parameters

EmailService $emailService

the service responsible for sending the overdue email

Return Value

void