Upgrade Guide

Upgrading to 8.0 from 7.x

Estimated upgrade time: 5-10 minutes

We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application.

PHP 7.3 required

The new minimum PHP version is now 7.3.

Updating dependencies

Update your laravel-zero/framework dependency to ^8.0 in your composer.json file.

Update Illuminate dependencies

If you are using any components (Database, Queue, etc.) that use Illuminate dependencies, these will need to be updated to ^8.0.

Update component dependencies

The following Components have bumped their minimum dependencies. It's unlikely you will need to change anything with these as the previous version selectors include the latest versions.

  • Console Dusk: nunomaduro/laravel-console-dusk bumped to ^1.8
  • Http: guzzlehttp/guzzle bumped to ^6.5.5|^7.0
  • Menu: nunomaduro/laravel-console-menu bumped to ^3.1
  • Schedule List: hmazter/laravel-schedule-list bumped to ^2.2

PHPUnit 9.3

Although Laravel Zero 8 will work with PHPUnit 8.5 or 9.x, we'd recommend updating to use ^9.3 which has a syntax change to the configuration file. The changes applied to update this in the Laravel Zero template can be found in commit 3712842.

Upgrading To 7.0 From 6.x

Estimated Upgrade Time: 5-10 Minutes

We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application.

PHP 7.2.5 required

The new minimum PHP version is now 7.2.5.

Updating Dependencies

Update your laravel-zero/framework dependency to ^7.0 in your composer.json file.

Symfony 5 required

Laravel Zero 7 upgraded its underlying Symfony components to the 5.x series, which is now also the new minimum compatible version.

Update any symfony/* dependencies to ^5.0 in your composer.json file where necessary.

PHPUnit changes

Laravel Zero 7 now requires a minimum of Collision v4.1.0 which updated the PHPUnit adapter class name.

Remove the NunoMaduro\Collision\Adapters\Phpunit\Listener class from your listeners block in your phpunit.xml.dist file.

If you are using the Logo component

The Logo component now depends on the Laminas Text package for Figlet generation.

Replace your zendframework/zend-text dependency with "laminas/laminas-text": "^2.7" in your composer.json.

Configuration changes

The app.production configuration value has been removed and replaced by an app.env value in order to match Laravel.

Replace 'production' => false with 'env' => 'development' in your config/app.php file.

Upgrading To 6.0 From 5.8

Estimated Upgrade Time: 2 - 5 Minutes

We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application.

Updating Dependencies

Update your laravel-zero/framework dependency to ^6.0 in your composer.json file.

If you are using Laravel's String & Array Helper

All str_ and array_ helpers have been moved to the new laravel/helpers Composer package and removed from the framework. If desired, you may update all calls to these helpers to use the Illuminate\Support\Str and Illuminate\Support\Arr classes. Alternatively, you can add the new laravel/helpers package to your application to continue using these helpers:

composer require laravel/helpers

Upgrading To 5.8 From 5.7

Estimated Upgrade Time: 2 - 5 Minutes

We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application.

Updating Dependencies

Update your laravel-zero/framework dependency to 5.8.* in your composer.json file.

If you are using the menu method

The command::menu() method got removed from the core of Laravel Zero to an optional component. Using the app:install Artisan command you can install the menu component again:

php <your-app-name> app:install menu

If you are using the dotenv addon

Update your vlucas/phpdotenv dependency to ^3.0 in your composer.json file.

Upgrading To 5.7 From 5.6

Estimated Upgrade Time: 2 - 5 Minutes

We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application.

Updating Dependencies

Update your laravel-zero/framework dependency to 5.7.* in your composer.json file.

Of course, don't forget to examine any 3rd party packages consumed by your application and verify you are using the proper version for Laravel Zero 5.7 support.

If you are using testing

Add the mockery/mockery package with version ^1.0 to the require-dev section of your composer.json file.

Update the contents of the following files:

  • tests/CreatesApplication.php:
<?php

namespace Tests;

use Illuminate\Contracts\Console\Kernel;

trait CreatesApplication
{
    /**
     * Creates the application.
     *
     * @return \Illuminate\Foundation\Application
     */
    public function createApplication()
    {
        $app = require __DIR__.'/../bootstrap/app.php';

        $app->make(Kernel::class)->bootstrap();

        return $app;
    }
}
  • tests/TestCase.php:
<?php

namespace Tests;

use LaravelZero\Framework\Testing\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
{
    use CreatesApplication;
}

If you are using the build feature

The internal behavior of build feature has changed. We are now using humbug/box to provide fast application bundling.

You should create a new file box.json on the root folder of your application with the following content:

{
    "chmod": "0755",
    "directories": [
        "app",
        "bootstrap",
        "config",
        "vendor"
    ],
    "files": [
        "composer.json"
    ],
    "exclude-composer-files": false,
    "compression": "GZ",
    "compactors": [
        "Herrera\\Box\\Compactor\\Php",
        "Herrera\\Box\\Compactor\\Json"
    ]
}

The option app:build with-dev option no longer exists, and the config/app.php structure parameter also no longer exists. In order to configure your build, you should configure the box.json file. Check github.com/humbug/box/blob/master/doc/configuration.md for more details.

Upgrading To 5.6 From 4.0

Estimated Upgrade Time: 5 - 15 Minutes

We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application.

PHP

Laravel Zero 5.6 requires PHP 7.1.3 or higher.

Updating Dependencies

Update your laravel-zero/framework dependency to 5.6.* in your composer.json file.

Of course, don't forget to examine any 3rd party packages consumed by your application and verify you are using the proper version for Laravel 5.6 support.

PHPUnit

You must update the phpunit/phpunit dependency of your application to ~7.0.

Bootstrap

You must create the bootstrap/cache folder to hold application services cache. The content of this new folder should be a single .gitignore with the following content:

*
!.gitignore

Please remove the files bootstrap/autoload.php and bootstrap/init.php. And create the file bootstrap/app.php with the contents of the file: https://github.com/laravel-zero/laravel-zero/blob/v5.6.6/bootstrap/app.php.

Application entry point

The file that you use to interact with your application should contain now the following content: https://github.com/laravel-zero/laravel-zero/blob/v5.6.6/application.

Configs

The commands.php File

You should create a config/commands.php with the contents of https://github.com/laravel-zero/laravel-zero/blob/v5.6.6/config/commands.php. Please customize the created file in order to determine the commands that should appear in your ListCommand.

The app.php File

  • App config with-scheduler is no longer available. You should use config/commands.php for it.
  • App config default-command is no longer available. You should use config/commands.php for it.
  • App config commands-paths is no longer available. You should use config/commands.php for it.
  • App config commands is no longer available. You should use config/commands.php for it.

The value version on config/app.php should be updated to app('git.version').

The database.php File

If you have the database component installed, please take into consideration the following updates:

  • Database config with-migrations is no longer available. You should use config/commands.php for it.
  • Database config with-seeds is no longer available. You should use config/commands.php for it.

Tests

On every tests, you should replace $this->app->call() and $this->app->output() by the Artisan facade. Example: Artisan::call and Artisan::output.

The variable $this->app will now contain a base application class of Laravel, that is the container itself.