CodeHubOrg / codehub-mentorships

CodeHub Mentorship platform - built with Laravel and React
3 stars 0 forks source link

Laravel 7.x Shift #67

Closed fourstacks closed 4 years ago

fourstacks commented 4 years ago

This pull request includes the changes for upgrading to Laravel 7.x. Feel free to commit any additional changes to the shift-30026 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.

fourstacks commented 4 years ago

:information_source: Laravel 7 upgraded to Symfony 5 which passes instances of the Throwable interface instead of Exception instances to core components like the Exceptions\Handler.

Shift automated this change. However, if you receive a Throwable type mismatch error there may be additional references you need to convert.

fourstacks commented 4 years ago

:information_source: Laravel 7 moved the Authentication components into a separate laravel/ui package, which includes the make commands as well as the traits related to authentication.

Shift added this dependency for convenience. However, if you do not plan to use the Authentication components, you may remove this dependency as well as the Auth controllers from your application.

fourstacks commented 4 years ago

:warning: The MAIL_DRIVER environment variable was renamed in Laravel 7 to MAIL_MAILER in order to support multiple mail configurations.

Shift attempted to automation this change, but you should review any additional environment configuration and update to the new variable name.

fourstacks commented 4 years 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. This is an effort to make maintaining config files easier.

You should review this commit for any additional customizations. If you have a lot of customizations, you may wish to undo this commit with git revert and make these config file changes manually.

fourstacks commented 4 years ago

:information_source: Shift updated your dependencies for Laravel 7. 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 7.

Watch dealing with dependencies for tips on handling package incompatibilities.

fourstacks commented 4 years ago

:information_source: Laravel 7 removed some of the PHPUnit configuration in favor of the defaults. While this is not a required changed, it is a good opportunity to compare your phpunit.xml with the default Laravel 7 version to modernize your configuration.

fourstacks commented 4 years ago

:warning: Laravel 7 uses a new date format when serializing models. The previous format was 2019-12-02 20:01:00. Now, dates are serialized using an ISO-8601 compatible date format of 2019-12-02T20:01:00.283041Z in UTC.

This does not affect how dates are stored. Only how they are serialized when using the toArray or toJson Eloquent methods.

If you need to preserve the previous format, you may override the serializeDate method on your model. Review the Date Serialization section of the Upgrade Guide for more details.

fourstacks commented 4 years ago

:information_source: All of the underlying Symfony components used by Laravel have been upgraded to Symfony 5. If you are directly interacting with Symfony components, you should review the Symfony change log for additional changes.

fourstacks commented 4 years ago

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

The following Shifts may be used ensure your application is fully upgraded and following practices recommended by Laravel and the community:

You may run these Shifts and stay upgraded forever as well by subscribing to a Shifty Plans.

fourstacks commented 4 years ago

@katjad - once this is merged into master we'll be running L7.x so you'll be able to use that enum package to handle things like those status fields. If you want to hop on a Tuple call at any point to run through how to use those enum classes effectively just let me know