From 219279c641a482e0508f56c379aab4eddcf7be18 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Thu, 21 May 2026 22:21:19 +0530 Subject: [PATCH] Added vehicle report mail pages --- app/Mail/VehicleEntryMail.php | 90 ++++++++++++++++++ .../views/mail/vehicle_entry_report.blade.php | 92 +++++++++++++++++++ 2 files changed, 182 insertions(+) create mode 100644 app/Mail/VehicleEntryMail.php create mode 100644 resources/views/mail/vehicle_entry_report.blade.php diff --git a/app/Mail/VehicleEntryMail.php b/app/Mail/VehicleEntryMail.php new file mode 100644 index 0000000..77aa42f --- /dev/null +++ b/app/Mail/VehicleEntryMail.php @@ -0,0 +1,90 @@ +scheduleType = $scheduleType; + $this->tableData = $tableData ?? []; + $this->mailSubject = $mailSubject ?? 'Vehicle Entry Report'; + } + + /** + * Get the message envelope. + */ + public function envelope(): Envelope + { + return new Envelope( + subject: 'Vehicle Entry Mail', + ); + } + + /** + * Get the message content definition. + */ + public function content(): Content + { + $greeting = 'Dear Sir'; + + //$greeting1 = 'Dear C.R.I Branch Team,

Please follow and ensure the same'; + + if ($this->scheduleType == 'Daily') { + $reportPeriod = ""; + $greeting .= $reportPeriod; + } + + if ($this->scheduleType == 'Hourly') { + $now = now(); + $fromHour = $now->copy()->subHour()->format('H:i:s'); + $toHour = $now->format('H:i:s'); + $reportDate = $now->format('d/m/Y'); + $greeting .= "from: $reportDate, $fromHour to $toHour.

Please arrange to receipt the same immediately."; + } + + if ($this->scheduleType == 'Live') { + $now = now(); + $fromMinute = $now->copy()->subMinute()->format('d/m/Y H:i:s'); + $toMinute = $now->format('d/m/Y H:i:s'); + $greeting .= "from: $fromMinute to $toMinute.

Please arrange to receipt the same immediately."; + } + + return new Content( + view: 'mail.vehicle_entry_report', + with: [ + 'company' => 'CRI Digital Manufacturing Solutions', + 'greeting' => $greeting, + 'tableData' => $this->tableData, + 'wishes' => 'Thanks & Regards,
CRI Digital Manufacturing Solutions', + ], + ); + } + /** + * Get the attachments for the message. + * + * @return array + */ + public function attachments(): array + { + return []; + } +} diff --git a/resources/views/mail/vehicle_entry_report.blade.php b/resources/views/mail/vehicle_entry_report.blade.php new file mode 100644 index 0000000..75a9d11 --- /dev/null +++ b/resources/views/mail/vehicle_entry_report.blade.php @@ -0,0 +1,92 @@ + + + + + Vehicle Entry Report + + + +
+ {{ $company }} +
+
+

{!! $greeting !!}

+
+ @if(empty($tableData)) +

No vehicle entry data available.

+ @else + + + + + + + + + + + + + + @foreach ($tableData as $row) + + + + + + + + + + @endforeach + +
NoPlant NameVehicle NumberEntry TimeExit TimeDurationType
{{ $loop->iteration }}{{ $row['plant'] }}{{ $row['vehicleNumber'] }}{{ $row['entryTime'] }}{{ $row['exitTime'] }}{{ $row['duration'] }}{{ $row['type'] }}
+ @endif +

{!! $wishes !!}

+
+ +