Artisan command to convert from mad-web/laravel-enum to webfox/laravel-backed-enums #42
Jim-Webfox
announced in
Announcements
Replies: 1 comment
-
|
As I find more aspects that can be changed, I will keep updating this command. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Migrating from
mad-web/laravel-enumtowebfox/laravel-backed-enumsThis document outlines a process for migrating Laravel projects from
mad-web/laravel-enumtowebfox/laravel-backed-enums.Motivation:
Many of our projects currently use
mad-web/laravel-enum, and we aim to transition them towebfox/laravel-backed-enumsfor improved functionality and maintainability.Assumptions:
constdeclarations (e.g.,const VALUE = 'value';).webfox/laravel-backed-enumsis already installed in the project (composer require webfox/laravel-backed-enums).app/Enumsdirectory.Functionality:
This process automates the following changes:
Enum Conversion: Converts existing
mad-web/laravel-enumclasses towebfox/laravel-backed-enums, generating the necessary cases based on the existingconstvalues. For example:Usage Updates: Modifies all usages of the enums to be compatible with
webfox/laravel-backed-enums. This includes changing how enum values are accessed. For example:Command
Beta Was this translation helpful? Give feedback.
All reactions