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 11.x Shift #1389

Merged
merged 51 commits into from
May 6, 2024
Merged

Laravel 11.x Shift #1389

merged 51 commits into from
May 6, 2024

Conversation

alexjustesen
Copy link
Owner

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

Before merging, you need to:

  • Checkout the shift-116575 branch
  • Review all pull request comments for additional changes
  • 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.

@alexjustesen

This comment was marked as resolved.

@alexjustesen

This comment was marked as resolved.

@alexjustesen
Copy link
Owner Author

ℹ️ Laravel 11 no longer requires you to maintain the default configuration files. Your configuration now merges with framework defaults.

Shift streamlined your configuration files by removing options that matched the Laravel defaults and preserving your true customizations. These are values which are not changeable through ENV variables.

If you wish to keep the full set of configuration files, Shift recommends running artisan config:publish --all --force to get the latest configuration files from Laravel 11, then reapplying the customizations Shift streamlined.

@alexjustesen
Copy link
Owner Author

ℹ️ Shift detected customized options within your configuration files which may be set with an ENV variable. To help keep your configuration files streamlined, you may set the following variables. Be sure adjust any values per environment.

APP_NAME="Speedtest Tracker"
BCRYPT_ROUNDS=10
BROADCAST_CONNECTION=log
CACHE_STORE=file
DB_CONNECTION=mysql
LOG_CHANNEL=stderr
LOG_LEVEL=error
MAIL_FROM_NAME="Speedtest Tracker"
MAIL_MAILER=smtp
QUEUE_CONNECTION=sync
SESSION_DRIVER=file

Note: some of these may simply be values which changed between Laravel 10 and Laravel 11. You may ignore any ENV variables you do not need to customize.

@alexjustesen
Copy link
Owner Author

⚠️ The BROADCAST_DRIVER, CACHE_DRIVER, and DATABASE_URL environment variables were renamed in Laravel 11 to BROADCAST_CONNECTION, CACHE_STORE, and DB_URL, respectively.

Shift automated this change for your committed files, but you should review any additional locations where your environment is configured and update to the new variable names.

@alexjustesen
Copy link
Owner Author

⚠️ Laravel 11 automatically discovers events by scanning your application's Listeners directory.

Shift detected event listeners registered with the listen property of your EventServiceProvider. If any of these listeners can not be automatically discovered, you may register them manually using Event::listen() in your AppServiceProvider.

@alexjustesen

This comment was marked as resolved.

@alexjustesen
Copy link
Owner Author

⚠️ Laravel 10 has added a return type of array to the Event broadcastOn and Notification via methods. However, you may still return a single channel from these methods.

Shift added the array return type to these methods in the following classes. You should review them to ensure you are returning an array, or remove the return type.

  • app/Notifications/Telegram/SpeedtestNotification.php
  • app/Notifications/Telegram/TestNotification.php

@alexjustesen

This comment was marked as resolved.

@alexjustesen

This comment was marked as resolved.

@alexjustesen
Copy link
Owner Author

⚠️ In Laravel 11, changing a column now requires you to include all the modifiers you want to keep on the column definition after it is changed. Any missing attributes will be dropped. This change may cause unexpected behavior if you were to run pending or old migrations.

Shift detected potential uses of the change method within your migrations. While you may go back and update these migrations, you may wish to simply squash your old migrations. This will not only avoid rework, but may also improve the performance of your test suite.

@alexjustesen

This comment was marked as resolved.

@alexjustesen

This comment was marked as resolved.

@alexjustesen

This comment was marked as resolved.

@alexjustesen
Copy link
Owner Author

Tests are currently failing but nothing useful is in the test suite at the moment, time to merge.

@alexjustesen alexjustesen merged commit ce21ae2 into main May 6, 2024
1 of 2 checks passed
@alexjustesen alexjustesen deleted the shift-116575 branch May 6, 2024 12:00
@alexjustesen alexjustesen added this to the v0.20.0 milestone Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 chore Nothing fancy, just needs to get done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants