copain

How to redirect notification to post_id

Posted 11 months ago by copain

Hello i'm trying to create notification everytime there is a new post ,when they click one of the notification link it will re direct to the post and show the post, is it possible without using vue.js

here is my code;

Controller:
  public function readbyid(Notification $notification){

 Auth::user()->unreadnotifications()->find($request->id)->markAsRead();
        return redirect()->back();
}


Route:

Route::get('markread/{notification}', '[email protected]' ); 


View Blade:

 @foreach(auth()->user()->unreadnotifications as $notify)
                    <li><a rel="nofollow" href="{{Url('notification/')}}" class="dropdown-item d-flex"> 
                    
                        <div class="msg-body">
                        <h3 class="h5">{{$notify->data['title']}}</h3>
                        </div> </a></li>@endforeach

right now with my code i cannot view the post,

Please sign in or create an account to participate in this conversation.