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 #143

Merged
merged 9 commits into from Aug 3, 2019
Merged

Laravel 5.4 Shift #143

merged 9 commits into from Aug 3, 2019

Conversation

mattstauffer
Copy link
Member

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

Before merging, you should:

  • Checkout the shift-16542 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.
@mattstauffer
Copy link
Member 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.

@mattstauffer
Copy link
Member 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.

@mattstauffer
Copy link
Member Author

mattstauffer commented Aug 3, 2019

❌ 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
  • webpack.mix.js

@mattstauffer
Copy link
Member 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.

@mattstauffer
Copy link
Member Author

mattstauffer commented Aug 3, 2019

❌ 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/services.php

@mattstauffer
Copy link
Member Author

mattstauffer commented Aug 3, 2019

❌ The getParameter method of the Illuminate\Routing\Route class has been renamed in Laravel 5.4. You should use the parameter method instead.

Shift found potential uses of getParameter() in:

  • app/Exceptions/Handler.php

@mattstauffer
Copy link
Member 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.

@mattstauffer
Copy link
Member Author

⚠️ Shift found a dependency for laravel/socialite. Laravel Socialite 3.0 and above is compatible with Laravel 5.4. You should ensure your version meets this requirement.

@mattstauffer
Copy link
Member 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.

@mattstauffer
Copy link
Member 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.

@mattstauffer
Copy link
Member 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.

@mattstauffer
Copy link
Member 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.

@mattstauffer
Copy link
Member Author

mattstauffer commented Aug 3, 2019

Todo:

  • Convert scripts to a stack because using @parent doesn't work the same in 5.4

@mattstauffer mattstauffer merged commit 4a6e34b into master Aug 3, 2019
@mattstauffer mattstauffer deleted the shift-16542 branch August 3, 2019 18:09
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.

None yet

2 participants