Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 10.x Shift #300

Merged
merged 46 commits into from
Dec 16, 2023
Merged

Laravel 10.x Shift #300

merged 46 commits into from
Dec 16, 2023

Conversation

dsbilling
Copy link
Member

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

Before merging, you need to:

  • Checkout the shift-106177 branch
  • Review all pull request comments for additional changes
  • Run composer update (if the scripts fail, add --no-scripts)
  • Clear any config, route, or view cache
  • Thoroughly test your application (no tests?, no CI?)

If you need help with your upgrade, check out the Human Shifts.

PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.
Accessing Faker properties was deprecated in Faker 1.14.
In an effort to make upgrading the constantly changing config files
easier, Shift defaulted them and merged your true customizations -
where ENV variables may not be used.
@dsbilling
Copy link
Member Author

dsbilling commented Dec 10, 2023

ℹ️ 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.

  • app/Rules/IPHostnameARecord.php
  • app/Rules/OlderThan.php
  • app/Rules/StrMustContain.php
  • app/Rules/StrNotContain.php
  • app/Rules/YoungerThan.php

@dsbilling
Copy link
Member Author

⚠️ Early versions of Laravel 9 included a lang/en.json file containing password validation messages. However, this file was quickly removed in favor of keeping this with the other validation rules within validation.php.

Shift detected your version differed from the default Laravel version. If you have customized the password validation messages, you should merge them with the password messages in validation.php and remove lang/en.json.

@dsbilling
Copy link
Member Author

dsbilling commented Dec 10, 2023

❌ Shift could not upgrade the following files since they differed from the default Laravel version. You will need to compare these files against the default Laravel 10 versions and merge any changes:

  • lang/en/validation.php

@dsbilling
Copy link
Member Author

ℹ️ Laravel added the VITE_APP_NAME environment variable to allow you to customize your application name in frontend components. By default, this uses the value from the APP_NAME environment variable.

Shift added this to your .env files, but you will need to update your frontend components to use this new variable. You may reference the original Breeze PR for examples.

@dsbilling
Copy link
Member Author

⚠️ 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 fb112381 and make the config file changes manually.

@dsbilling
Copy link
Member Author

dsbilling commented Dec 10, 2023

ℹ️ 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.

@dsbilling
Copy link
Member Author

⚠️ 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.

@dsbilling
Copy link
Member Author

ℹ️ 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.

@dsbilling
Copy link
Member Author

ℹ️ 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.

@dsbilling
Copy link
Member Author

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

@dsbilling
Copy link
Member Author

ℹ️ 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.

@dsbilling dsbilling self-assigned this Dec 10, 2023
@dsbilling dsbilling marked this pull request as draft December 10, 2023 16:40
@dsbilling dsbilling marked this pull request as ready for review December 16, 2023 22:12
@dsbilling dsbilling merged commit ba0415a into develop Dec 16, 2023
4 checks passed
@dsbilling dsbilling deleted the shift-106177 branch December 16, 2023 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants