HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/hours.komma.pro/app/Komma/Notifications/NotificationController.php
<?php

namespace App\Komma\Notifications;

use App\Http\Controllers\Controller;

class NotificationController extends Controller
{
    protected $notificationService;

    public function __construct(NotificationService $notificationService)
    {
        $this->middleware('auth');
        $this->notificationService = $notificationService;
    }


    /**
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function index()
    {
        $notifications = $this->notificationService->getAllNotifications()->paginate(10);

        return view('notifications.index', compact('notifications'));
    }

    /**
     * @param $notification
     */
    public function delete($notification)
    {
        $this->notificationService->delete($notification);

        $notifications = Notification::orderBy('done_at')->paginate(10);

        return response($notifications);
    }


}