Skip to content

Laravel 5.4 Shift #4

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

Merged
merged 10 commits into from
Feb 12, 2021
Merged

Laravel 5.4 Shift #4

merged 10 commits into from
Feb 12, 2021

Conversation

roarkmccolgan
Copy link
Owner

This pull request includes the changes for upgrading to Laravel 5.4. Feel free to commit any additional changes to the shift-40683 branch.

Before merging, you need to:

  • Checkout the shift-40683 branch
  • Review all pull request comments for additional changes
  • Update your dependencies for Laravel 5.4
  • Run composer update (if the scripts fail, add --no-scripts)
  • Thoroughly test your application

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 automatically applies the Laravel coding style - which uses the PSR-2 coding style as a base with some minor additions.

You may customize the adopted coding style by adding your own [PHP CS Fixer][1] `.php_cs` config file to your project root. Feel free to use [Shift's Laravel ruleset][2] to help you get started.

[1]: https://github.com/FriendsOfPHP/PHP-CS-Fixer
[2]: https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200
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.
Laravel has deprecated the `fire()` helper and `Event::fire()`.
These will be removed in Laravel 5.8. Use the `event()` helper
instead.
PHP 5.5.9+ adds the new static `class` property which provides the fully qualified class name. This is preferred over using class name strings as these references are checked by the parser.
@roarkmccolgan
Copy link
Owner Author

ℹ️ Laravel 5.4 added new middleware to handle whitespace in request data. This may affect the data your application received. Read this post on Laravel News for more detail to see if you need to modify your application.

@roarkmccolgan
Copy link
Owner Author

⚠️ Laravel Elixir changed to Laravel Mix in Laravel 5.4 which uses Webpack, instead of Gulp. While you may still use Gulp, you may need to revert the dependencies and scripts in your package.json file to their previous values.

@roarkmccolgan
Copy link
Owner Author

roarkmccolgan commented Feb 12, 2021

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

  • package.json

@roarkmccolgan
Copy link
Owner Author

⚠️ Laravel 5.4 changed the Pusher configuration options from PUSHER_KEY to PUSHER_APP_KEY and PUSHER_SECRET to PUSHER_APP_SECRET.

While Shift automated this change throughout your code, you should check for any additional references in files like .env which may not be included in your Git repository.

@roarkmccolgan
Copy link
Owner Author

⚠️ Since you are upgrading from an older version of Laravel, Shift defaulted your customized configuration files to improve the automation in your next Shift. This was done in a separate commit so you may easily reference the changes and backfill your customizations once you are done Shifting. Future Shifts (Laravel 6+) will preserve your true customizations by merging them back in with the defaults.

  • config/database.php
  • config/mail.php
  • config/queue.php
  • config/services.php

@roarkmccolgan
Copy link
Owner Author

❌ The container's make method no longer accepts a second parameter to pass arguments into the container in Laravel 5.4. Ideally, you should construct this object through the container or registering a callback.

However, this functionality was reintroduced by the makeWith method instead. Shift converted these calls to makeWith. But you will need to manually update these to map the arguments to their respective constructor parameter names.

@roarkmccolgan
Copy link
Owner Author

⚠️ Support for later, send, queue, and queueOn methods of the Mail facade has changed in Laravel 5.4. While these methods will still work, you should upgrade your application to use Mailables.

Shift found potential uses of these methods in:

  • app/Http/Controllers/AssessmentController.php
  • app/Http/Controllers/ItalyController.php
  • app/Http/Controllers/ToolController.php
  • app/Jobs/SendReports.php
  • app/Listeners/SendRegisteredEmail.php

@roarkmccolgan
Copy link
Owner Author

❌ Shift found a dependency for Guzzle. Laravel 5.4 requires Guzzle 6.0 or higher. Please ensure your version meets this requirement.

@roarkmccolgan
Copy link
Owner Author

ℹ️ In Laravel 5.4, the date cast creates a Carbon object which calls startOfDay. If you need to preserve the time portion of the date, you should use the datetime cast or convert your column to a datetime. Review the documentation on Attribute Casting for more details.

@roarkmccolgan
Copy link
Owner Author

ℹ️ Laravel 5.4 no longer includes the ability to customize the PDO "fetch style". Now PDO::FETCH_OBJ is always used. If you need to customize the fetch style, check the Database section of the Upgrade Guide for more details.

@roarkmccolgan
Copy link
Owner Author

⚠️ Per the Upgrade Guide, you should run php artisan view:clear and php artisan route:clear after upgrading all packages to flush the view and route cache.

@roarkmccolgan
Copy link
Owner Author

ℹ️ If you are running MySQL prior to version 5.7.7, you may receive a specified key was too long error. You can either upgrade your MySQL or review this post for code to resolve this issue.

@roarkmccolgan
Copy link
Owner Author

❌ PHP syntax errors were detected after running your Shift. Often these are simply differences between the PHP version of Shift and your project. Occasionally they are misplaced lines.

You can check the PHP syntax by running php -l on the following files:

  • app/Options.php
  • app/Other.php
  • app/Position.php

@roarkmccolgan roarkmccolgan merged commit 3b5c661 into master Feb 12, 2021
@roarkmccolgan roarkmccolgan deleted the shift-40683 branch February 12, 2021 13:38
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