check if user has account

This commit is contained in:
ilmedova 2022-12-05 17:01:39 +05:00
parent 2016834ec3
commit 3d22434acc
1 changed files with 3 additions and 1 deletions

View File

@ -119,7 +119,9 @@ public function postTicket(TicketRequest $request)
$ticket = new Ticket($request->only('content', 'title','category_id'));
$client = $request->user();
$ticket['client_id'] = $client->id;
$ticket['account_id'] = $client->account_id;
if($client->account_id){
$ticket['account_id'] = $client->account_id;
}
$status = Status::where('name', 'Open')->firstOrFail();
$ticket['status_id'] = $status->id;
$ticket['last_sender'] = 'client';