changed logic in bid transporter page #129

Merged
jothi merged 1 commits from ranjith-dev into master 2026-01-24 09:24:08 +00:00

View File

@@ -17,10 +17,15 @@ class EditRfqTransporterBid extends EditRecord
protected function afterSave(): void
{
if (! $this->record->wasChanged('total_freight_charge')) {
return;
}
// dd($this->record);
$rank = RfqTransporterBid::where('request_quotation_id', $this->record->request_quotation_id)
->orderBy('total_freight_charge')
->pluck('id')
@@ -29,20 +34,29 @@ class EditRfqTransporterBid extends EditRecord
$recipients = User::role(['Super Admin', 'Rfq Supervisor'])->get();
$currentUser = Filament::auth()->user();
if ($currentUser && ! $recipients->contains('id', $currentUser->id)) {
$recipients->push($currentUser);
}
$user1 = Filament::auth()->user();
// $user1 = Filament::auth()->user();
$body = "$currentUser current rank is #{$rank}";
Notification::make()
->title('Rank Updated')
->body("$currentUser current rank is #{$rank}")
->body("{$currentUser->name} current rank is #{$rank}")
->success()
->sendToDatabase($recipients);
\Log::info('Notification sent', [
'rank' => $rank,
'recipients' => $recipients->pluck('id'),
]);
foreach ($recipients as $user) {
$user->notify(
new PushAlertNotification(