Skip to content

Link to resource? #2

Open
Open

Description

@ppisecky

Is it possible to link to a resource in the notifications list?

Activity

  1. chrisbjr commented on Feb 2, 2019

    @chrisbjr
    Member

    Not at the moment. Will add this feature soon.

  2. tumainimosha commented on Jun 18, 2019

    @tumainimosha

    I am not sure if this is the same issue I am having or a different one.

    In the toArray() method of notification, we supply the $url parameter, which I expected should act as clickable link for the notification.

    However, I am unable to click through the notifications that pop-up.

    is this expected behaviour, or there something missing in my setup.

  3. nilsE commented on Jul 26, 2019

    @nilsE

    would be great to have a link!

  4. MGMonge commented on Aug 22, 2019

    @MGMonge

    I needed a different template for the notifications on one of my projects so I made this PR #20 to allow custom notification templates

    You can change the notification template completely like this.

    // file: resources/views/custom-nova-notification-feed.blade.php
    
    <notification-feed>
        <template v-slot="{ notification }">
            <notification-message :notification="notification" inline-template>
                <a class="notification table mt-4 table-fixed w-full" :href="notification.data.url">
                    <div class="table-cell w-full">
                        <p v-html="notification.data.message"></p>
                        <span class="text-sm text-70">@{{ notification.created_at | fromNow }}</span>
                    </div>
                </a>
            </notification-message>
        </template>
    </notification-feed>
    
    

    Will this feature help you guys @chrisbjr @ppisecky @tumainimosha @nilsE ?

  5. CaddyDz commented on Aug 2, 2020

    @CaddyDz

    Here is how am doing it for now

    public function toArray($notifiable): array
    {
    	$base_path = config('app.url') . config('nova.path');
    	return [
    		'level' => $this->level,
    		'message' => $this->message,
    		'url' => $base_path . '/resources/users/' . $this->user->id,
    		'target' => '_self'
    	];
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions