PaymentType::where('code', 'cash')->pluck('id')->first(), time: 60 * 60 * 24 ); } /** * Payment values */ public static function values(): array { return CacheRepository::make( name: 'cs-nova-models-order-payments', value: fn () => PaymentType::pluck('name', 'id')->toArray() ); } /** * Old but good types * * @return array */ public static function oldButGoodTypes(): array { return [ static::ATM => __('ATM'), static::CASH => __('Cash'), ]; } /** * Formatted payment type for given "type" */ public static function formattedPaymentTypeFor(string $type): string { return static::values()[$type] ?? self::CASH; } }