model = app(SparePart::class); $data = SparePartReport::run($request, $report); return $this->response->message(trans('messages.success.updated', ['Module' => trans('shop::spare_part.name')])) ->code(204) ->data(compact('data')) ->status('success') ->url(guard_url('shop/spare_part/' . $report)) ->redirect(); } catch (Exception $e) { return $this->response->message($e->getMessage()) ->code(400) ->status('error') ->url(guard_url('shop/spare_part/' . $report)) ->redirect(); } } }