Laravel 10.x Shift #49
Reference in New Issue
Block a user
Delete Branch "shift-91885"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request includes the changes for upgrading to Laravel 10.x. Feel free to commit any additional changes to the
shift-91885branch.Before merging, you need to:
shift-91885branchcomposer update(if the scripts fail, add--no-scripts)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.
ℹ️ Shift noticed you have additional namespaces in your application. You may use the Consolidate Namespaces Shift to simplify your namespaces into the default Laravel
Appnamespace.ℹ️ Laravel 10 deprecated the
ImplicitRule,InvokableRule, andRulecontracts in favor of using the new, streamlinedValidationRulecontract. 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
ValidationRulecontract.⚠️ Shift upgraded your configuration files by defaulting them and merging your true customizations. These include values which are not changeable through core
ENVvariables.You should review this commit for additional customizations or opportunities to use new
ENVvariables. If you have a lot of customizations, you may undo this commit withgit revert 3ad2b2fband make the config file changes manually.ℹ️ 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.
ℹ️ 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.
ℹ️ Laravel 9 adopted anonymous migrations. Shift automated this change to align with modern Laravel conventions and avoid naming migrations.
ℹ️ Laravel renamed the
password_resetstable topassword_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 yourconfig/auth.phpfile. Be sure to runphp artisan migrateto complete your upgrade.ℹ️ 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.
ℹ️ Now with type hints in your code, defining types within PHP DocBlocks is redundant. Laravel has removed all of the
@paramand@returntags 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.⚠️ 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 thegetValue()method. Query builder methods will continue to handleDB::raw()expressions directly. This likely only affects instances where you are usingDB::raw()expression in your own code.Shift detected calls to
DB::raw(). You should review these instances to see if you are attempting to use them as a string.ℹ️ 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:
git revert 5faf496to revert the DocBlock changes.git revert 4d7d0edto revert the type hints added from DocBlocks.git revert 979b9f7to revert the type hints added for Laravel 10.ℹ️ 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.
⚠️ Laravel 10 requires Composer 2.2 or higher. You should verify the Composer version in your environments by running
composer --versionto ensure it meets this new requirement. If necessary, runcomposer self-updateto update Composer.🎉 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.