2 Commits

Author SHA1 Message Date
20de7e9b71 Merge pull request 'Added logic for gate out entry for out time' (#726) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #726
2026-06-08 05:27:49 +00:00
dhanabalan
f7bfc1373d Added logic for gate out entry for out time
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 34s
Laravel Pint / pint (pull_request) Successful in 13m14s
Laravel Larastan / larastan (pull_request) Failing after 15m42s
2026-06-08 10:56:35 +05:30

View File

@@ -54,15 +54,27 @@ class GateOutEntry extends Page implements HasForms
$entry = VisitorEntry::where('register_id', $gatePass)->first(); $entry = VisitorEntry::where('register_id', $gatePass)->first();
if ($entry) { if ($entry) {
$entry->out_time = now();
$entry->save();
Notification::make() if (!empty($entry->out_time)) {
->title('Gate Pass Processed') Notification::make()
->body('Gate pass has been successfully processed. Visitor marked as exited.') ->title('Already Exited')
->success() ->body('Gate pass has already been processed. Out time was already punched.')
->send(); ->warning()
$this->filters['scan_out_gate_pass'] = ''; ->send();
$this->filters['scan_out_gate_pass'] = '';
return;
}
else{
$entry->out_time = now();
$entry->save();
Notification::make()
->title('Gate Pass Processed')
->body('Gate pass has been successfully processed. Visitor marked as exited.')
->success()
->send();
$this->filters['scan_out_gate_pass'] = '';
}
} else { } else {
Notification::make() Notification::make()
->title('Invalid Gate Pass') ->title('Invalid Gate Pass')