Merge pull request 'changed logic in bid transporter page' (#129) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #129
This commit was merged in pull request #129.
This commit is contained in:
@@ -17,10 +17,15 @@ class EditRfqTransporterBid extends EditRecord
|
|||||||
|
|
||||||
protected function afterSave(): void
|
protected function afterSave(): void
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (! $this->record->wasChanged('total_freight_charge')) {
|
if (! $this->record->wasChanged('total_freight_charge')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dd($this->record);
|
||||||
|
|
||||||
$rank = RfqTransporterBid::where('request_quotation_id', $this->record->request_quotation_id)
|
$rank = RfqTransporterBid::where('request_quotation_id', $this->record->request_quotation_id)
|
||||||
->orderBy('total_freight_charge')
|
->orderBy('total_freight_charge')
|
||||||
->pluck('id')
|
->pluck('id')
|
||||||
@@ -29,19 +34,28 @@ class EditRfqTransporterBid extends EditRecord
|
|||||||
$recipients = User::role(['Super Admin', 'Rfq Supervisor'])->get();
|
$recipients = User::role(['Super Admin', 'Rfq Supervisor'])->get();
|
||||||
$currentUser = Filament::auth()->user();
|
$currentUser = Filament::auth()->user();
|
||||||
|
|
||||||
|
|
||||||
if ($currentUser && ! $recipients->contains('id', $currentUser->id)) {
|
if ($currentUser && ! $recipients->contains('id', $currentUser->id)) {
|
||||||
$recipients->push($currentUser);
|
$recipients->push($currentUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
$user1 = Filament::auth()->user();
|
// $user1 = Filament::auth()->user();
|
||||||
|
|
||||||
|
$body = "$currentUser current rank is #{$rank}";
|
||||||
|
|
||||||
|
|
||||||
|
Notification::make()
|
||||||
|
->title('Rank Updated')
|
||||||
|
->body("{$currentUser->name} current rank is #{$rank}")
|
||||||
|
->success()
|
||||||
|
->sendToDatabase($recipients);
|
||||||
|
|
||||||
|
\Log::info('Notification sent', [
|
||||||
|
'rank' => $rank,
|
||||||
|
'recipients' => $recipients->pluck('id'),
|
||||||
|
]);
|
||||||
|
|
||||||
$body = "$currentUser current rank is #{$rank}";
|
|
||||||
|
|
||||||
Notification::make()
|
|
||||||
->title('Rank Updated')
|
|
||||||
->body("$currentUser current rank is #{$rank}")
|
|
||||||
->success()
|
|
||||||
->sendToDatabase($recipients);
|
|
||||||
|
|
||||||
foreach ($recipients as $user) {
|
foreach ($recipients as $user) {
|
||||||
$user->notify(
|
$user->notify(
|
||||||
|
|||||||
Reference in New Issue
Block a user