File: D:/HostingSpaces/MdnDirecteur/hours.komma.cloud/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);
}
}