Skip to content

Commit

Permalink
Update CompaniesController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Azelis authored Aug 13, 2023
1 parent 07bafa9 commit ed5b4ca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Http/Controllers/CompaniesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public function store(ImageUploadRequest $request)
$company->name = $request->input('name');
$company->phone = $request->input('phone');
$company->fax = $request->input('fax');
$company->email = $request->input('email');

$company = $request->handleImages($company);

Expand Down Expand Up @@ -115,6 +116,7 @@ public function update(ImageUploadRequest $request, $companyId)
$company->name = $request->input('name');
$company->phone = $request->input('phone');
$company->fax = $request->input('fax');
$company->email = $request->input('email');

$company = $request->handleImages($company);

Expand All @@ -123,8 +125,7 @@ public function update(ImageUploadRequest $request, $companyId)
->with('success', trans('admin/companies/message.update.success'));
}

return redirect()->route('companies.edit', ['company' => $companyId])
->with('error', trans('admin/companies/message.update.error'));
return redirect()->back()->withInput()->withErrors($company->getErrors());
}

/**
Expand Down

0 comments on commit ed5b4ca

Please sign in to comment.