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 6.x Shift #421

Merged
merged 13 commits into from
Nov 15, 2021
Merged

Laravel 6.x Shift #421

merged 13 commits into from
Nov 15, 2021

Conversation

restart-tech
Copy link
Contributor

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

Before merging, you need to:

  • Checkout the shift-51682 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?)

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 a [PHP CS Fixer][1] or [PHP CodeSniffer][2] config to your project root. Feel free to use [Shift's Laravel ruleset][3] to help you get started.

For more information on customizing the code style applied by Shift, [watch this short video][4].

[1]: https://github.com/FriendsOfPHP/PHP-CS-Fixer
[2]: https://github.com/squizlabs/PHP_CodeSniffer
[3]: https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200
[4]: https://laravelshift.com/videos/shift-code-style
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.
@restart-tech
Copy link
Contributor Author

❌ 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 6 versions and merge any changes:

  • app/Http/Controllers/Auth/ResetPasswordController.php
  • app/Http/Kernel.php
  • resources/lang/en/passwords.php
  • resources/lang/en/validation.php

@restart-tech
Copy link
Contributor Author

⚠️ Laravel 6.x consolidated references to /home as a constant within the RouteServiceProvider. This makes it easier to maintain and change in a single place.

Shift automated this change, but could not upgrade the following files since they differed from the default Laravel version. You should compare these files against the default Laravel 6 versions and merge this change:

  • app/Http/Controllers/Auth/LoginController.php
  • app/Http/Controllers/Auth/RegisterController.php
  • app/Http/Middleware/RedirectIfAuthenticated.php

@restart-tech
Copy link
Contributor 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 964267bb and make the config file changes manually.

@restart-tech
Copy link
Contributor Author

ℹ️ Laravel 6 changed the default Redis client from predis to phpredis. You may keep using predis by setting REDIS_CLIENT=predis for your environment.

@restart-tech
Copy link
Contributor Author

ℹ️ Shift updated your dependencies for Laravel 6. 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 6.

Watch dealing with dependencies for tips on handling any additional package incompatibilities.

@restart-tech
Copy link
Contributor Author

ℹ️ The Eloquent model's toArray() method will now cast any attributes that implement Illuminate\Contracts\Support\Arrayable to an array. While unlikely to impact your application, this change could effect code which relies upon the previous data type or output.

@restart-tech
Copy link
Contributor Author

ℹ️ Laravel 6 now requires Carbon 2. While Shift reviewed your application for common breaking changes, you may want to review the Carbon 2 migration notes for additional changes.

@restart-tech
Copy link
Contributor Author

⚠️ PHPUnit 8 deprecated using assertContains for strings. This assertion now only handles arrays or Traversable objects.

Shift attempted to convert assertions where possible, but detected additional uses of assertContains you should review and, if these arguments are strings, convert them to the new string assertion methods.

  • tests/Feature/Groups/GroupCreateTest.php
  • tests/Feature/Groups/GroupDeleteTest.php
  • tests/Feature/Groups/GroupEditTest.php
  • tests/Feature/Groups/GroupHostTest.php
  • tests/Feature/Groups/GroupJoinTest.php
  • tests/Unit/Events/CoordinatorTests.php
  • tests/Unit/NetworkTests.php

@restart-tech
Copy link
Contributor Author

⚠️ Previous versions of Laravel would bind parameters passed to the URL helper methods as placeholder values even if the names mismatched. In Laravel 6, named parameters not matching placeholders are attached to the query string instead.

Shift detected the following route() and action() calls passing named parameters you should review to ensure they match the route placeholder name.

  • app/Http/Controllers/MobifixOraController.php
  • app/Http/Controllers/PrintcatOraController.php
  • resources/views/networks/partials/add-group-modal.blade.php
  • resources/views/partials/notification.blade.php
  • resources/views/user/notifications.blade.php

@restart-tech
Copy link
Contributor Author

ℹ️ Laravel 6 made performance optimizations for integer key types. If you are using a string as your model's primary key, you may set the $keyType property on your model.

/**
 * The "type" of the primary key ID.
 *
 * @var string
 */
protected $keyType = 'string';

@restart-tech
Copy link
Contributor Author

ℹ️ The mandrill and sparkpost mail drivers, as well as the rackspace storage driver were removed in Laravel 6. If you were using these drivers, you may adopt a community maintained package which provides the driver.

@restart-tech
Copy link
Contributor Author

ℹ️ Previous versions of Laravel would retry jobs indefinitely. Beginning with Laravel 6, the php artisan queue:work now tries a job one time by default. If you want to force jobs to be tried indefinitely, you may pass the --tries=0 option.

@restart-tech
Copy link
Contributor Author

🎉 Congratulations, you've made it to the latest LTS version. However, Shift encourages you to keep going to the latest Laravel version. No reason to remain on this older version and acquire technical debt when you're so close...

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
7.1% 7.1% Duplication

@edwh edwh merged commit 1e86837 into develop Nov 15, 2021
@restart-tech restart-tech deleted the shift-51682 branch December 1, 2022 10:24
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.

3 participants