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

Open
wants to merge 50 commits into
base: master
Choose a base branch
from
Open

Laravel 11.x Shift #523

wants to merge 50 commits into from

Conversation

thekevinm
Copy link
Contributor

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

Before merging, you need to:

  • Checkout the shift-124321 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.

@thekevinm
Copy link
Contributor Author

ℹ️ To slim down the Laravel installation, Laravel 11 no longer has most of the core files previously included in the default Laravel application. While you are welcome to publish and customize these files, they are no longer required.

Shift takes an iterative approach to removing core files which are not customized or where its customizations may be done elsewhere in a modern Laravel 11 application. As such, you may see some commits removing files and others re-registering your customizations.

@thekevinm
Copy link
Contributor Author

⚠️ Shift detected a custom namespace. Laravel now recommends keeping the default App namespace. Unfortunately the app:name command was removed in Laravel 6.0. However, for the most part you may do a simple search and replace to change the namespace.

Shift recommends changing this to align with the latest Laravel conventions and improve Shift's automation. After doing so, you may request a rerun of this Shift.

@thekevinm
Copy link
Contributor Author

ℹ️ Laravel 9 moved the resources/lang folder to the top level of the project. While Shift automated this change, you may have additional references to the previous folder which need to be updated.

@thekevinm
Copy link
Contributor Author

ℹ️ Starting with Laravel 10, the lang folder is no longer included in a default Laravel application. Laravel now recursively merges any customizations with framework defaults.

Shift streamlined your language files by removing them since they did not contain any customizations. If you wish to keep the full set of language, Shift recommends running artisan config:publish --all --force to get the latest configuration files from Laravel 11, then reapplying the customizations Shift streamlined.

@thekevinm
Copy link
Contributor 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.

@thekevinm
Copy link
Contributor 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=DreamFactory
ARGON_MEMORY=1024
ARGON_THREADS=2
ARGON_TIME=2
AUTH_MODEL=\DreamFactory\Core\Models\User
AUTH_PASSWORD_RESET_TOKEN_TABLE=password_resets
BCRYPT_ROUNDS=10
CACHE_STORE=file
DB_CACHE_CONNECTION=sqlite
DB_DATABASE=dreamfactory
DB_HOST=127.0.0.1
DB_USERNAME=
LOG_LEVEL=warning
LOG_STDERR_FORMATTER=Monolog\Formatter\LineFormatter
MAIL_MAILER=smtp
QUEUE_CONNECTION=sync
REDIS_CLIENT=predis
REDIS_QUEUE_CONNECTION=queue
SESSION_DRIVER=array
SESSION_SECURE_COOKIE=false

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

@thekevinm
Copy link
Contributor Author

ℹ️ Shift detected your application uses custom ENV variables for configuration options which have ENV variables in Laravel. Shift recommends renaming the following variables to use the one provided by Laravel:

  • APP_LOG_LEVEL to LOG_LEVEL
  • CACHE_PERSISTENT_ID to MEMCACHED_PERSISTENT_ID
  • CACHE_TABLE to DB_CACHE_TABLE
  • DB_CONNECTION to DB_CACHE_CONNECTION
  • FILESYSTEM_DRIVER to FILESYSTEM_DISK
  • QUEUE_HOST to BEANSTALKD_QUEUE_HOST
  • QUEUE_NAME to REDIS_QUEUE
  • QUEUE_RETRY_AFTER to REDIS_QUEUE_RETRY_AFTER
  • REDIS_DATABASE to REDIS_DB

@thekevinm
Copy link
Contributor 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.

@thekevinm
Copy link
Contributor Author

❌ The bootstrap/app.php file has been completely rewritten in Laravel 11 to allow configuring your Laravel application in a single location. Shift overwrote your file, but detected it may have contained customizations. You should review the diff to see if any of your customizations are still needed.

@thekevinm
Copy link
Contributor Author

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

Next, you may optionally run the following Shifts to ensure your application is fully upgraded, adopts the latest Laravel conventions, and easier to maintain in the future:

  • Laravel Fixer automatically updates your code to the latest Laravel conventions.
  • Tests Generator intelligently generates model factories, HTTP Tests, and configuration for your application.
  • CI Generator intelligently generates CI jobs to lint PHP, check code style, and run tests, including Dusk.

You may also use the Shift Workbench to automate common tasks for maintaining your Laravel application.

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