Untitled

mail@pastecode.io avatarunknown
javascript
20 days ago
715 B
0
Indexable
Never
    function store(Request $request)
    {

        $data = $request->only(['indebted', 'creditor', 'type', 'notes', 'account_to', 'account_from']);
        try {
            $result = $this->transactionService->saveTransactionData($data);
            return $this->apiResponse($result, $this->SUCCESS_MESSAGE, $this->SUCCESS_CODE);
        } catch (\InvalidArgumentException $e) {
            Log::error($e->getMessage());
            return $this->apiResponse('', $e->getMessage(), $this->INVALID_PARAMETERS_ERROR_CODE);
        } catch (\Exception $e) {
            Log::error($e->getMessage());
            return $this->apiResponse('', $e->getMessage(), $this->SERVER_ERROR_CODE);
        }
    }