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.0 Shift #272

Closed
wants to merge 14 commits into from
Closed

Laravel 6.0 Shift #272

wants to merge 14 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Sep 28, 2019

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

Before merging, you need to:

  • Checkout the shift-19036 branch
  • Review all pull request comments for additional changes
  • Update your dependencies for Laravel 6.0
  • Run composer update (if the scripts fail, add --no-scripts)
  • 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.

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
by using your [PHP CS Fixer][1] config within your project.

You may use [Shift's .php_cs][2] file as a base.

[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 so you can review the commit diff for
changes. Moving forward, you should use ENV variables or create a
separate config file to allow the core config files to remain
automatically upgradeable.
@ghost
Copy link
Author

ghost commented Sep 28, 2019

⚠️ Shift defaulted the following configuration files. This was done in the Default config files commit so you may easily review and backfill your customizations. If you have a lot of customizations, you may also undo this commit with git revert and upgrade these files manually.

  • config/broadcasting.php
  • config/cache.php
  • config/database.php
  • config/filesystems.php
  • config/logging.php
  • config/mail.php
  • config/queue.php
  • config/services.php

@ghost
Copy link
Author

ghost commented Sep 28, 2019

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

However, if possible, consider switching to phpredis to gain the performance of its PHP extension and avoid using the deprecated predis dependency which will be removed in Laravel 7.0.

@ghost
Copy link
Author

ghost commented Sep 28, 2019

ℹ️ Laravel 6.0 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';

@ghost
Copy link
Author

ghost commented Sep 28, 2019

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

@ghost
Copy link
Author

ghost commented Sep 28, 2019

ℹ️ Previous versions of Laravel would retry jobs indefinitely. Beginning with Laravel 6.0, 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.

@ghost
Copy link
Author

ghost commented Sep 28, 2019

ℹ️ 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.

@ghost
Copy link
Author

ghost commented Sep 28, 2019

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

The following Shifts can ensure your app is fully upgraded and following the practices recommended by Laravel and the community:

  • Laravel Linter analyzes your codebase for potential opportunities to do things "The Laravel Way".
  • Laravel Fixer automates many of the suggestions found by the Linter and other Shifts.
  • Upgrade Checker ensures your application is fully upgraded by detecting any outdated code.

In addition, stay upgraded forever as well as run these Shifts by subscribing to one of the new Shifty Plans.

@Lordin
Copy link

Lordin commented Sep 29, 2019

ℹ️ Laravel 6.0 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';

i have problem with some records when i was using 'with'. Some records were showing null relations, even they had. After i add protected $keyType = 'string'; to the Modal the relations works.

@wjgilmore wjgilmore closed this Sep 1, 2021
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