record->wasChanged('total_freight_charge')) { return; } $rank = RfqTransporterBid::where('request_quotation_id', $this->record->request_quotation_id) ->orderBy('total_freight_charge') ->pluck('id') ->search($this->record->id) + 1; $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(); $body = "$currentUser current rank is #{$rank}"; Notification::make() ->title('Rank Updated') ->body("$currentUser current rank is #{$rank}") ->success() ->sendToDatabase($recipients); foreach ($recipients as $user) { $user->notify( new PushAlertNotification( 'Rank Updated', $body ) ); } } protected function getHeaderActions(): array { return [ Actions\ViewAction::make(), Actions\DeleteAction::make(), Actions\ForceDeleteAction::make(), Actions\RestoreAction::make(), ]; } }