From 34cd3e76729c113baba8b963a37a6d03aa7eabb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 4 May 2021 12:37:15 +0200 Subject: [PATCH] filter tickets with user project_id --- app/Http/Controllers/TicketController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Http/Controllers/TicketController.php b/app/Http/Controllers/TicketController.php index 3c2db8d..f8fc8f2 100644 --- a/app/Http/Controllers/TicketController.php +++ b/app/Http/Controllers/TicketController.php @@ -33,6 +33,9 @@ class TicketController extends Controller public function index(SortTickets $request) { $tickets = Ticket::query(); + if (auth()->user()->project_id) { + $tickets = $tickets->where('project_id', auth()->user()->project_id); + } if ($request->status) { $tickets = $tickets->where('status', TicketStatus::archived());