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 5.4 Shift #5

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Laravel 5.4 Shift #5

wants to merge 8 commits into from

Conversation

miguelbalparda
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-15586 branch.

Before merging, you should:

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

If you want help with your upgrade, check out the Shift Human Services or join the Shifty Coders Slack room to get answers to all your Laravel questions.

The Laravel framework adopts the PSR-2 coding style with some additions.
Laravel apps *should* adopt this coding style as well.

However, Shift allows you to customize the adopted coding style through
the [.shiftrc][1] file by using your [PHP CS Fixer][2] config.

[1]: https://laravelshift.com/shiftrc-configuration-file
[2]: https://github.com/FriendsOfPHP/PHP-CS-Fixer
Laravel 5.1 requires PHP 5.5.9+ which provides the new static `class`
property to get the fully qualified name of a class and is preferred
over using class name strings.
@miguelbalparda
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.

@miguelbalparda
Copy link
Owner Author

❌ Shift could not upgrade app/Providers/BroadcastServiceProvider.php. You will need to compare yours against the 5.4 version and merge any new changes. You should also add the new routes/channels.php file into your application.

@miguelbalparda
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.

@miguelbalparda
Copy link
Owner Author

❌ 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
  • resources/assets/js/bootstrap.js

@miguelbalparda
Copy link
Owner Author

ℹ️ Laravel 5.4 changed the Pusher configuration options PUSHER_KEY and PUSHER_SECRET to PUSHER_APP_KEY and PUSHER_APP_SECRET respectively. Shift has attempted to change these throughout your application. Nonetheless, you should search for any additional references, particularly in files like .env which may not be included in your Git repository.

@miguelbalparda
Copy link
Owner Author

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

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

@miguelbalparda
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 in another way. However, this functionality was reintroduced by using the makeWith method instead.

Shift found potential uses of passing argument to make in:

  • app/Services/Logic/SocialManager.php

@miguelbalparda
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/Services/Notifications/Channels/MailChannel.php

@miguelbalparda
Copy link
Owner Author

⚠️ Laravel 5.4's testing layer has been re-written. Instead of upgrading your tests, Shift installed the Laravel BrowserKit Testing package. This will allow you to test the Laravel 5.4 upgrade with your existing tests.

Once you have verified the upgrade, you can use the Laravel 5.4 Tests Shift to upgrade your tests to the new Laravel 5.4 testing layer.

@miguelbalparda
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.

@miguelbalparda
Copy link
Owner Author

❌ In Laravel 5.4, the trans function signature changed. It no longer accepts the $domain argument.

Shift found potential uses of trans() in:

  • app/Services/Logic/TripsManager.php

@miguelbalparda
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.

@miguelbalparda
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.

@miguelbalparda
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.

@miguelbalparda
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.

@miguelbalparda
Copy link
Owner Author

ℹ️ While it was common to customize in previous versions, Laravel now recommends keeping the default App namespace. This will also improve your upgrade process. You can easily change it to the default by running php artisan app:name App. After doing so, you are welcome to request a rerun of this Shift.

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