Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel onclick all notification reads

class UserNotificationsController extends Controller
{

/**
     * @param  int  $id  Notification ID
     * @return IlluminateHttpResponse
     */
    public function show($id)
    {
        $notification = auth()->user()->notifications()->where('id', $id)->first();

        if ($notification) {
            $notification->markAsRead();
            return redirect($notification->data['link']);
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: php header x-powered-by 
Php :: QR CODE FROM CAMCODES 
Php :: php connect 
Php :: relationship on the base of condition in laravel 
Php :: how to show image in easyadmin 3 index page 
Php :: acf if image else display other image 
Php :: count rows mysql limit php 
Php :: how to create header in csv file inphp 
Php :: get row ezSql | select on ezSql 
Php :: keep value after submit php 
Php :: yii form custom label 
Php :: Identify the PHP function used to print the content 
Php :: simple using mdb with php script PDO 
Php :: many to many relationship in laravel example stackoverflow 
Php :: sha256 encode php 
Php :: wp plugin handles 
Php :: automatice prevent default the form in php 
Php :: laravel sendgrid using 2 possible authenticators. Authenticator LOGIN returned Expected response code 250 
Php :: how we show full name of month in posts 
Php :: laravel jobs cache file picking old job file 
Php :: Same Taxonomy Add Multiple Post Type 
Php :: ipv6 pregmatch 
Php :: laravel csrf token or protection or laravel form 
Php :: barryvdh laravel dompdf pages total 
Php :: import csv file in laravel 
Php :: how to check if page is opened by bot 
Php :: PHP Installation broken - shows strange php code as response 
Php :: Custom searchform 
Php :: laravel store mail driver info in database 
Php :: get product price with thousands separator 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =