PHP Enums tryFrom Method
I was recently working on a project where I was receiving data from an API that had a payment_type. I converted the payment_type into the enum below: enum PaymentType: string { case CREDIT_CARD = 'credit_card'; case APPLE_PAY = 'apple_pay'; ...
Aug 11, 20232 min read1.7K
