Fix ticket answer when Admin to force subscribe
This commit is contained in:
parent
05b7f3c5f9
commit
be43700f65
1 changed files with 10 additions and 2 deletions
|
|
@ -41,8 +41,16 @@ class Message extends Model
|
|||
}
|
||||
// ? Is message author is admin ?
|
||||
if ($messageUser->isAdmin()) {
|
||||
$ticket->subscriptions()->attach($messageUser);
|
||||
\session()->flash('info', trans('Vous avez été inscrit.'));
|
||||
// TODO: investigate why this make errors on prod,
|
||||
// https://supportweb.ldc.fr/ticket/583/message/create
|
||||
// SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '583-8' for key 'PRIMARY'
|
||||
// $ticket->subscriptions()->attach($messageUser);
|
||||
|
||||
// Add subscription
|
||||
if (!$messageUser->subscriptions()->find($ticket->id)) {
|
||||
$messageUser->subscriptions()->attach($ticket->id);
|
||||
\session()->flash('info', trans('Vous avez été inscrit.'));
|
||||
}
|
||||
}
|
||||
// * Send mail to other subscribed users
|
||||
event(new NotifySubscriptions(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue