Hotfix create ticket

This commit is contained in:
Jérémy Munsch 2022-06-17 09:37:21 +02:00
parent da27907625
commit 9bc9f8007a
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
2 changed files with 5 additions and 4 deletions

View file

@ -190,13 +190,14 @@ class TicketController extends Controller
$ticket->file2 = ToolboxHelper::storeImage($ticket->getTable(), $fileTicket2);
}
if ($request->labels) {
$ticket->labels()->sync($request->labels);
}
$ticket->user()->associate(auth()->user());
$ticket->site()->associate($site);
$ticket->saveOrFail();
if ($request->labels) {
$ticket->labels()->sync($request->labels);
}
$user->subscriptions()->toggle($ticket->id);
if (config('mail.MAIL_ADMIN')) {

View file

@ -41,7 +41,7 @@ $userPr = Auth::user()->sites ?? collect([]);
@php
$dataVue = [
'name' => 'labels',
'value' => old('labels', optional($ticket ?? null)->labels),
'value' => optional($ticket ?? null)->labels,
'labels' => \App\Models\Label::all()
];
@endphp