- Copy both files to the appropriate namespace.
- Register the Rector rule:
->withRules([ RenameEnumCasesToPascalCaseRector::class, ])
- Run Rector:
vendor/bin/rector process
- Run the command to apply the same changes to Blade files:
php artisan refactor:blade-enums
All set!
- This approach does not work if you use
self::YOUR_CASE
in the enum class. - It also fails if you use the following pattern in Blade templates:
@use('App\Enums\SomeBigNameEnum', 'YourEnum')
- Avoid running the process twice to prevent conflicts.