arborrow / montserrat

A retreat management application written in Laravel
12 stars 4 forks source link

Laravel 10.x Shift #550

Closed arborrow closed 1 year ago

arborrow commented 1 year ago

This pull request includes the changes for upgrading to Laravel 10.x. Feel free to commit any additional changes to the shift-84452 branch.

Before merging, you need to:

If you need help with your upgrade, check out the Human Shifts. You may also join the Shifty Coders Slack workspace to level-up your Laravel skills.

arborrow commented 1 year ago

:warning: Shift upgraded your configuration files by defaulting them and merging your true customizations. These include values which are not changeable through core ENV variables.

You should review this commit for additional customizations or opportunities to use new ENV variables. If you have a lot of customizations, you may undo this commit with git revert 167c20c2 and make the config file changes manually.

arborrow commented 1 year ago

:information_source: Shift updated your dependencies for Laravel 10. While many of the popular packages are reviewed, you may have to update additional packages in order for your application to be compatible with Laravel 10. Watch dealing with dependencies for tips on handling any Composer issues.

The following dependencies were updated by a major version and may have their own changes. You may check their changelog for any additional upgrade steps.

arborrow commented 1 year ago

:warning: Shift detected you are running Laravel Sail. If you have not customized your stack, you should run php artisan sail:install to regenerate the latest docker-compose.yml. Otherwise, Shift attempted to update Sail for PHP 8.1. However, you should review your docker-compose.yml to ensure your stack is running PHP 8.1 or higher.

arborrow commented 1 year ago

:information_source: Laravel renamed the password_resets table to password_reset_tokens. While an optional change, Shift detected you have a migration for this table and created a migration to rename it as well as updated the reference in your config/auth.php file. Be sure to run php artisan migrate to complete your upgrade.

arborrow commented 1 year ago

:information_source: Laravel 10 added PHP type hints to all user-land code included in a new Laravel application. In an effort to modernize your code, Shift added type hints to any method which is used by Laravel, as well as any method which had types defined in its PHP DocBlock.

arborrow commented 1 year ago

:information_source: Now with type hints in your code, defining types within PHP DocBlocks is redundant. Laravel has removed all of the @param and @return tags from its DocBlocks where types are defined with PHP. Similarly, Shift removed these tags from any DocBlock where the code now has equivalent type hints.

arborrow commented 1 year ago

:information_source: Shift understands you may wish to preserve your full DocBlock even with PHP type hints in code. All of Shift's automation is done in nice, atomic commits. So you may easily undo this change by running git revert 35a81ed5.

arborrow commented 1 year ago

:warning: In Laravel 10 you may no longer directly cast a DB:raw() expression to a string. Instead, you must retrieve the value from the expression using the getValue() method.

Shift detected calls to DB::raw(). You should review these instances to see if you are casting the result to a string.

arborrow commented 1 year ago

:information_source: All of the underlying Symfony components used by Laravel have been upgraded to Symfony 6.2. Shift detected references to Symfony classes within your application. You should review the Symfony change log for any additional changes.

arborrow commented 1 year ago

:information_source: Laravel began using Vite to build frontend assets in Laravel 9.19. While you may continue to use Laravel Mix, it is no longer the default. If you wish to modernize your application to use Vite, you may run the Vite Converter for free.

arborrow commented 1 year ago

:warning: Laravel 10 requires Composer 2.2 or higher. You should verify the Composer version in your environments by running composer --version to ensure it meets this new requirement. If necessary, run composer self-update to update Composer.

arborrow commented 1 year ago

:tada: Congratulations, you're now running the latest version of Laravel!

Next, you may optionally run the following Shifts to ensure your application is fully upgraded, adopts the latest Laravel conventions, and easier to maintain in the future:

You may also use the Shift Workbench to automate common tasks for maintaining your Laravel and PHP applications.

arborrow commented 1 year ago

:x: PHP syntax errors were detected after running your Shift. Often these are simply differences between the PHP version on the Shift server (8.1) and your project. Occasionally they are misplaced lines or duplicate import statements.

You may quickly check the PHP syntax locally by running php -l on the following files:

arborrow commented 1 year ago

I needed to get stuyam/laravel-phone-validator upgraded first but did some work on master so I will just re-run the shift on current master.