app/Http/Requests/StoreTransactionRequest.php
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
Get the validation rules that apply to the request.
@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
        $additionalTransactionRules = [
            "account_id" => "required|integer|exists:accounts,id",
            "bill_id" => "required|integer|exists:billings,id",
        ];
        $transactionRules = array_merge(
            ValidationRules::storeTransactionRules(),
            ValidationRules::storeBillingRules(),
            $additionalTransactionRules
        );
        unset($transactionRules["transaction_comment"]);
        return $transactionRules;
    }
public function rules ( ) { $ additionalTransactionRules = [ " account_id " => " required|integer|exists:accounts,id " , " bill_id " => " required|integer|exists:billings,id " , ] ; $ transactionRules = array_merge ( ValidationRules :: storeTransactionRules ( ) , ValidationRules :: storeBillingRules ( ) , $ additionalTransactionRules ) ; unset ( $ transactionRules [ " transaction_comment " ] ) ; return $ transactionRules ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .
// remove the rule of transaction comments as we will be setting it programmatically when saving transaction