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-enum
towebfox/laravel-backed-enums
This document outlines a process for migrating Laravel projects from
mad-web/laravel-enum
towebfox/laravel-backed-enums
.Motivation:
Many of our projects currently use
mad-web/laravel-enum
, and we aim to transition them towebfox/laravel-backed-enums
for improved functionality and maintainability.Assumptions:
const
declarations (e.g.,const VALUE = 'value';
).webfox/laravel-backed-enums
is already installed in the project (composer require webfox/laravel-backed-enums
).app/Enums
directory.Functionality:
This process automates the following changes:
Enum Conversion: Converts existing
mad-web/laravel-enum
classes towebfox/laravel-backed-enums
, generating the necessary cases based on the existingconst
values. 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