Я пытаюсь установить приложение laravel 5.5 / postgres в Docker, и у меня возникла ошибка:
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
Чтобы исправить это в файле composer.json, я добавил строку:
"nesbot/carbon": "2 as 1.24.1"
поэтому composer.json имеет:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"barryvdh/laravel-debugbar": "^2.3",
"graham-campbell/markdown": "^8.0",
"intervention/image": "^2.3",
"khill/lavacharts": "3.0.*",
"laravel/framework": "5.5.*",
"laravel/socialite": "^3.0",
"laravel/tinker": "~1.0",
"laravelcollective/html": "^5.4.0",
"nwidart/laravel-modules": "^2.2",
"doctrine/dbal": "~2.5",
"wboyz/laravel-enum": "^0.2.1",
"nesbot/carbon": "2 as 1.24.1"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~6.0",
"stolz/laravel-html-tidy": "^0.1.1",
"xethron/migrations-generator": "^2.0",
"filp/whoops" : "~2.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/",
"Modules\\": "Modules/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
После запуска моего приложения я получил ошибку:
[2019-11-11 08:31:40] local.ERROR: Method addSeconds does not exist. {"exception":"[object] (BadMethodCallException(code: 0): Method addSeconds does not exist. at /var/www/lprods_docker_root/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php:96)
[stacktrace]
#0 /var/www/lprods_docker_root/vendor/laravel/framework/src/Illuminate/Support/InteractsWithTime.php(37): Illuminate\\Support\\Carbon->__call('addSeconds', Array)
и вижу, что addSeconds несколько раз использовался в каталоге vendor /.
Это проблема с версией? Как это исправить?
# php artisan --version
Laravel Framework 5.5.44