ranjith-dev #788

Merged
jothi merged 2 commits from ranjith-dev into master 2026-06-24 09:10:37 +00:00
Showing only changes of commit 33425d6549 - Show all commits

View File

@@ -2,6 +2,8 @@
namespace App\Filament\Pages;
use App\Mail\VisitorOutMail;
use App\Models\EmployeeMaster;
use App\Models\Plant;
use App\Models\VisitorEntry;
use Carbon\Carbon;
@@ -15,6 +17,8 @@ use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Notifications\Notification;
use Illuminate\Support\Facades\Auth;
use App\Mail\VisitorMail;
use Illuminate\Support\Facades\Mail;
class GateOutEntry extends Page implements HasForms
{
@@ -162,6 +166,16 @@ class GateOutEntry extends Page implements HasForms
$entry->out_time = now();
$entry->save();
$employee = EmployeeMaster::find($entry->employee_master_id);
if ($employee && !empty($employee->email)) {
Mail::to($employee->email)
->send(new VisitorOutMail($entry)); // or ->send()
}
else{
\Log::warning('No email found for employee ID: ' . $entry->employee_master_id);
}
Notification::make()
->title('Gate Pass Processed')
->body('Visitor marked as exited.')