mechawrench / wificom-webapp

WebApp portion of the WiFiCom Project
MIT License
2 stars 0 forks source link

Laravel 10.x Shift #14

Open mechawrench opened 1 year ago

mechawrench 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-95948 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.

mechawrench commented 1 year ago

:information_source: Laravel 10 deprecated the ImplicitRule, InvokableRule, and Rule contracts in favor of using the new, streamlined ValidationRule contract. These contracts will be removed in a future version of Laravel.

Given the change in the method names and return type, Shift can not reliably automate this change. At your convenience, you should review these custom validation rules and update them to implement the ValidationRule contract.

mechawrench 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 3e910b4f and make the config file changes manually.

mechawrench 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.

mechawrench commented 1 year ago

:information_source: Sanctum 3.x added an expires_at column to support expiring tokens. Shift detected you have a migration for this table and created a migration for this new column. Be sure to run php artisan migrate to complete your upgrade.

mechawrench commented 1 year ago

:information_source: Shift detected your application has a test suite. To make verifying the upgrade to Laravel 10 easier, Shift did not upgrade your test suite to PHPUnit 10. Once you have completed your upgrade, you may run the PHPUnit 10 Shift for free to upgrade your test suite to PHPUnit 10 separately.

mechawrench commented 1 year ago

:information_source: Laravel 9 adopted anonymous migrations. Shift automated this change to align with modern Laravel conventions and avoid naming migrations.

mechawrench 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.

mechawrench 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.

mechawrench 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.

mechawrench commented 1 year ago

:information_source: Shift understands developers have different preferences when it comes to type hints. All of Shift's automation is done in nice, atomic commits. This makes it easier to undo any of the changes Shift makes.

If you wish to undo the changes relating to type hints, you may run:

mechawrench 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.

mechawrench commented 1 year ago

:warning: Shift detected your application is using Pest. Since the release of Laravel 10, Pest v2 was released. To make verifying the upgrade to Laravel 10 easier, Shift did not upgrade your constraints for Pest. Once you have completed your upgrade, you may follow the Upgrade Guide to quickly upgrade to Pest v2.

mechawrench 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.

mechawrench 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.