getCarbonDate('date'); } public function getFromCurrency(): TransactionCurrency { return Amount::getTransactionCurrencyByCode((string) $this->get('from')); } public function getRate(): string { return (string) $this->get('rate'); } public function getToCurrency(): TransactionCurrency { return Amount::getTransactionCurrencyByCode((string) $this->get('to')); } /** * The rules that the incoming request must be matched against. */ public function rules(): array { return [ 'date' => ['required', 'date', 'after:1970-01-02', 'before:2038-01-17'], 'rate' => ['required', 'numeric', 'gt:0'], 'from' => ['required', 'exists:transaction_currencies,code'], 'to' => ['required', 'exists:transaction_currencies,code'], ]; } }