Most of the changes introduced by Laravel 5.6 are easy to integrate. However, the following might be a BREAKING CHANGE
to your application. Please review the following changes with caution:

Database: Index Order Of Morph Columns

The indexing of the columns built by the morphs migration method has been reversed for better performance. If you are
using the morphs method in one of your migrations, you may receive an error when attempting to run the migration’s
down method. If the application is still in development, you may use the migrate:fresh command to rebuild the database
from scratch. If the application is in production, you should pass an explicit index name to the morphs method.

Manual Tasks to do:

Update your own dependencies to new L5.6 compatible versions!

Add the new LOG_CHANNEL=stack to your environment file.

Copy the 2 new Laravel config files (hashing.php and logging.php) to /config/ folder in your main project tree.

Adjust the TrustProxies in App/Ship/Middlewares accordingly.

Check, if the described “breaking change” may affect your application!

Note: Some of the files are not required to be upgraded. And some of them, can be simply replaced by the new files
(copy a file content from the Apiato repository and replace it with your older version).

Hint: You can do a git merge and solve the conflicts, if you don’t want to manually do the changes commit by commit.

Important Information: Laravel 5.5 introduces an auto-discovery feature that lets you automatically register ServiceProviders.
Due to the nature and structure of Apiato applications, this features is turned off, because it messes up how config files are loaded
in apiato. This means, that you still need to manually register 3rd-party ServiceProviders in the ServiceProvider of a Container. (This should be a temporary situation)

Upgrade from 4.1 to 5.0

Estimated upgrading time: 15 minutes.

This guide will show you how to freshly install the new Apiato 5.0, then migrate your old project (built with Apiato 4.1)
to the freshly installed one (Apiato 5.0).

In the guide w’ll be using the term Old Project (referring to your old project that was built with Apiato 4.1),
and the term New Project (referring to the new freshly installed Apiato 5.0).

2) Delete the Containers directory app/Containers from the new project.

3) Move the Containers directory app/Containers from the old project to the new project.

4) Open this file app/Ship/composer.json in your old project and only copy the required dependencies, from the old project to the same file in the new project.

5) Again, open the app/Ship/composer.json file in the new project, and remove the following dependencies:
guzzlehttp/guzzle, prettus/l5-repository, barryvdh/laravel-cors, spatie/laravel-fractal, vinkla/hashids and johannesschobel/apiato-container-installer.

6) Move and replace the following directories from the old project to the new project: config, public, resources, database and storage.

7) Open config/app.php and replace App\Ship\Engine\Providers\PortoServiceProvider::class with Apiato\Core\Providers\ApiatoProvider::class.

8) Move .gitignore, phpunit.xml and .env files, from the old project to the new project.

9) Open the .env file on the new project and append this to it API_RATE_LIMIT_ENABLED=true.

10) Open phpunit.xml file of the new project and delete this line from the file <file>./app/Ship/Engine/Loaders/FactoryMixer/FactoriesLoader.php</file>.

11) If you had live testing data in your old project inside app/Ship/Seeders/Data/Testing/Seeders/TestingDataSeeder.php file, then copy that file content and past it in the new project inside app/Ship/Seeders/SeedTestingData.php. You will need to rename the class (not the file) from TestingDataSeeder to SeedTestingData,
and you will need to update the namespace from namespace App\Ship\Seeders\Data\Testing\Seeders; to namespace App\Ship\Seeders;.

12) If you ever used the HashIdTrait, you need to search and replace this namespace App\Ship\Engine\Traits\HashIdTrait with this Apiato\Core\Traits\HashIdTrait.

13) Run composer update. If you got any error at this step, try to solve it or open an Issue.

14) Move the .git directory from the old project to the new one. Add all changes git add . then commit git commit -m 'upgrade Apiato from 4.1 to 5.0'.

If you are upgrading to specific version (not the latest stable version “Master”) select your
version branch, set your upstream to track that
branch, example if you’re upgrading to 7.2 set it to git branch --set-upstream-to upstream/7.2.