Closed janis-rullis closed 3 years ago
composer.json
{
"laravel/framework": "^8.0",
"phpunit/phpunit": "^9.0"
}
From https://github.com/laravel/laravel/blob/8.x/composer.json or manually.
Can be added later one by one. Like
"fzaninotto/faker": "^1.4",
.
docker exec -it ruu-laravel5 bash
composer update -W
php artisan config:clear
in /var/www/app/Exceptions/Handler.php on line 35
PHP Fatal error: Declaration of App\Exceptions\Handler::report(Exception $exception) must be compatible with Illuminate\Foundation\Exceptions\Handler::report(Throwable $e) in /var/www/app/Exceptions/Handler.php on line 35
PHP Fatal error: Uncaught ReflectionException: Class App\Exceptions\Handler does not exist in /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php:873
Take the example from v.8. lib - https://github.com/laravel/laravel/blob/8.x/app/Exceptions/Handler.php
In ProviderRepository.php line 208:
Class 'Barryvdh\Cors\ServiceProvider' not found
docker stop ruu-laravel5
./start.sh
rm -f bootstrap/cache/config.php
composer clear-cache
composer dumpautoload -o
composer install
php artisan config:clear
php artisan cache:clear
php artisan migrate
Solved in https://github.com/Janis-Rullis-IT/lara5-vue2-api/issues/4#issuecomment-906990013
http://ruu.local/ opens but has problems with displaying products because http://api.ruu.local/products throws an error.
Right, doh, Docker still has the TAIL cmd instead of RUN.
docker stop ruu-laravel5
docker-compose build --no-cache ruu-laravel5
docker-compose up ruu-laravel5
laravel5/build/nginx/site.conf
Barryvdh\\Cors\\HandleCors] does not exist
Now Postman returns the expected output.
MissingAlloweOriginHeader
.
laravel5/config/cors.php
'allowedOrigins' => ['*'],
'allowedOriginsPatterns' => [],
but https://github.com/fruitcake/laravel-cors/blob/master/config/cors.php has allowed_origins
.
Yes, this is mentioned in https://github.com/fruitcake/laravel-cors#upgrading-from-0x--barryvdh-laravel-cors
The casing on the props in cors.php has changed from camelCase to snake_case, so if you already have a cors.php file you will need to update the props in there to match the new casing.
.
'paths' => ['*'],
.Now works.
root@cba9c206488f:/var/www# php artisan
Laravel Framework 8.56.0
https://laravel.com/docs/8.x/upgrade