ticket post and message post permission fixed

This commit is contained in:
ilmedova 2022-12-03 01:09:41 +05:00
parent 345533d75b
commit 5ef2c369db
1 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ public function postMessage(MessageRequest $request)
$ticket = Ticket::find($request->ticket_id);
if($ticket->last_sender == 'client'){
$users = User::with('permissions')->whereHas("permissions", function($q) {
$q->whereIn("name", ["tickets","Venue",'Organisation']);
$q->whereIn("name", ["tickets"]);
})->get();
Notification::send($users, new NewTicket());
}
@ -118,7 +118,7 @@ public function postTicket(TicketRequest $request)
$ticket['last_sender'] = 'client';
$ticket->save();
$users = User::with('permissions')->whereHas("permissions", function($q) {
$q->whereIn("name", ["tickets","Venue",'Organisation']);
$q->whereIn("name", ["tickets"]);
})->get();
Notification::send($users, new NewTicket());
return TicketResource::make($ticket);