Skip to content

Laravel 5.6 Shift#1

Open
kennedy-dev wants to merge 11 commits intodevfrom
shift-150775
Open

Laravel 5.6 Shift#1
kennedy-dev wants to merge 11 commits intodevfrom
shift-150775

Conversation

@kennedy-dev
Copy link
Copy Markdown
Owner

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

Before merging, you need to:

  • Checkout the shift-150775 branch
  • Review all pull request comments for additional changes
  • Update your dependencies for Laravel 5.6
  • Run composer update (if the scripts fail, try with --no-scripts)
  • Clear any config, route, or view cache
  • Thoroughly test your application (no tests?, no CI?)

If you need help with your upgrade, check out the Human Shifts.

Shift automatically applies the Laravel coding style - which uses the PSR-12 coding style as a base with some minor additions.

You may customize the code style applied by configuring [Pint](https://laravel.com/docs/pint), [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), or [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for your project root.

For more information on customizing the code style applied by Shift, [watch this short video](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.
PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.
@kennedy-dev
Copy link
Copy Markdown
Owner Author

⚠️ In Laravel 5.6 passing null to the Arr::wrap method will now return an empty array as opposed to an array with a null element.

Shift found potential uses of Array:wrap in:

  • tests/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php
  • tests/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php
  • tests/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php
  • tests/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
  • tests/vendor/laravel/framework/src/Illuminate/Database/Eloquent/ModelNotFoundException.php
  • tests/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php
  • tests/vendor/laravel/framework/src/Illuminate/Database/Seeder.php
  • tests/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php
  • tests/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php
  • tests/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php
  • tests/vendor/laravel/framework/src/Illuminate/Support/Collection.php
  • tests/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/EventFake.php
  • tests/vendor/laravel/framework/src/Illuminate/Support/helpers.php
  • tests/vendor/laravel/framework/src/Illuminate/Validation/ValidationException.php

@kennedy-dev
Copy link
Copy Markdown
Owner Author

⚠️ In Laravel 5.6, the e helper will double encode special characters by default. If you would like to maintain the previous behavior of preventing double encoding, you may pass false as the second argument to the e helper

Shift found potential uses of the e helper in:

  • resources/views.original/supervision-categories/create-structure.blade.php
  • resources/views/supervision-categories/create-structure.blade.php
  • resources/views/supervision-categories_1/create-structure.blade.php

@kennedy-dev
Copy link
Copy Markdown
Owner Author

⚠️ Shift found calls to the configureMonologUsing method in your application. In Laravel 5.6, you should create a custom Log channel instead. Check out the full logging documentation for creating custom channels.

  • tests/vendor/laravel/framework/src/Illuminate/Foundation/Application.php

@kennedy-dev
Copy link
Copy Markdown
Owner Author

⚠️ The Illuminate\Log\Writer class has been renamed to Illuminate\Log\Logger. If you were explicitly type hinting this class as a dependency of one of your application's classes, you should update the class reference to the new name. Or, alternatively, you should strongly consider type-hinting the standardized Psr\Log\LoggerInterface interface instead.

  • tests/vendor/laravel/framework/src/Illuminate/Foundation/Application.php

@kennedy-dev
Copy link
Copy Markdown
Owner Author

⚠️ Shift could not upgrade the following files since they differed from the default Laravel version. You should compare these application files against the default Laravel 5.6 versions and merge any changes:

  • app/Http/Controllers/Auth/RegisterController.php

@kennedy-dev
Copy link
Copy Markdown
Owner Author

ℹ️ Laravel 5.6 introduced a logging configuration file. You should ensure the log and log_level settings previously in the config/app.php are now set in config/logging.php.

@kennedy-dev
Copy link
Copy Markdown
Owner Author

⚠️ Since you are upgrading from an older version of Laravel, Shift defaulted your 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 running Shift.

Future Shifts (Laravel 6 and above) will preserve your true customizations by merging them with the defaults. As such, you should wait to backfill your customizations until you are ready to run the Laravel 6.x Shift or utilize the ENV variables instead.

  • config/database.php
  • config/mail.php

@kennedy-dev
Copy link
Copy Markdown
Owner Author

ℹ️ Laravel 5.6 recommends using the Hash facade instead of the bcrypt function directly as it provides greater flexibility for additional hashing algorithms and leverages the new hashing.php configuration.

Since Laravel uses the bcrypt algorithm by default, Shift converted your instances of bcrypt() to Hash::make().

@kennedy-dev
Copy link
Copy Markdown
Owner Author

ℹ️ In Laravel 5.6, the withSwiftMessage callback is now called before the content is added, which allows you to customize the encoding or other message options as needed.

Shift found the potential usage of withSwiftMessage in:

  • tests/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php

@kennedy-dev
Copy link
Copy Markdown
Owner Author

ℹ️ All of the underlying Symfony components used by Laravel have been upgraded to Symfony 4.0. If you are directly interacting with any Symfony components, you should review the Symfony change log for additional changes.

@kennedy-dev
Copy link
Copy Markdown
Owner Author

ℹ️ The optimize command was deprecated in Laravel 5.5 and removed in Laravel 5.6. However, it is re-added in Laravel 5.7. If you are using this command, it may be temporarily unavailable.

@kennedy-dev
Copy link
Copy Markdown
Owner Author

ℹ️ In Laravel 5.6, Blade will double encode special characters by default. If you would like to maintain the previous behavior of preventing double encoding, you may add Blade::withoutDoubleEncoding() to your AppServiceProvider boot method.

@kennedy-dev
Copy link
Copy Markdown
Owner Author

ℹ️ Laravel 5.6 uses Bootstrap 4 by default. Shift did not update your frontend resources or dependencies as this could impact your UI. If you are using Bootstrap and wish to continue using Bootstrap 3, you should add Paginator::useBootstrapThree() to your AppServiceProvider boot method.

@kennedy-dev
Copy link
Copy Markdown
Owner Author

⚠️ Laravel 5.6 has reached end of life. It no longer receives bug fixes or security updates. Shift recommends continuing to upgrade to the latest version (Laravel 12.x).

For tips on running multiple Shifts effectively, watch upgrading old Laravel applications.

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