app/Http/Controllers/UserController.php
/**
     * Paginar las notificaciones en el Header
     * @return JSON Array
     */
Paginar las notificaciones en el Header
@return JSON Array
Paginar las notificaciones en el Header @return JSON Array
public function notificationsPaged()
    {
        $user = User::findOrFail(Auth::id());
        $notifications = $user->notifications()->paginate(4);
        $today = Carbon::now();
        foreach ($notifications as $key => $notify) {
            $notify->time_ago = $today->diffForHumans($notify->created_at);
        }
        return response()->json($notifications);
    }
public function notificationsPaged ( ) { $ user = User :: findOrFail ( Auth :: id ( ) ) ; $ notifications = $ user -> notifications ( ) -> paginate ( 4 ) ; $ today = Carbon :: now ( ) ; foreach ( $ notifications as $ key => $ notify ) { $ notify -> time_ago = $ today -> diffForHumans ( $ notify -> created_at ) ; } return response ( ) -> json ( $ notifications ) ; }
Paginar las notificaciones en el Header
 @return JSON Array
Paginar las notificaciones en el Header @return JSON Array