#Is it possible to add a ViewAction in a Notification?

2 messages · Page 1 of 1 (latest)

buoyant marsh
#

Hi!
I would like to add a ViewAction into some DatabaseNotification, without success for now...

I did by best to add the more data I can to make filament retrieve the model I want to view but as far as I see into my database notifications stored data, the viewaction is correctly stored (and the button displayed in the ui), but there is no data to retrieve the model.

Notification::make()
    ->info()
    ->title(sprintf('%s mentioned you', $comment->author->name))
    ->body(sprintf('Comment on %s', $comment->commentable->asset->export_name))
    ->actions([
        ViewAction::make()
            ->model(AssetProductionCard::class)
            ->record($comment->commentable->getKey())
            ->schema($this->viewActionSchema())
            ->markAsRead(),
    ])
    ->sendToDatabase($notifiables);

Did someone made something similar??

hot eagleBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution