У меня сейчас обновлен laravel до 5.8 с 5.2.Благодаря этому процессу он работает и отображает сайт, но у меня нет всех 5,8 добавленных зависимостей, которые были бы там, как если бы я запустил проект с нуля на 5.8.Поэтому я создал проект laravel с нуля, чтобы посмотреть, что будет в нем включено, и начал медленно продвигать вещи.В настоящее время я пытаюсь получить composer.json, практически идентичный новому проекту laravel 5.8.Это то, что работало -
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": [ "framework", "laravel" ],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"laravel/framework": "5.8.*",
"intervention/image": "^2.3",
"guzzlehttp/guzzle": "^6.2",
"fideloper/proxy": "^4.0",
"laravel/cashier": "~7.0",
"codedge/laravel-fpdf": "^1.0",
"phpseclib/phpseclib": "1.0.*",
"laravelcollective/html": "~5.0",
"maatwebsite/excel": "^2.1",
"phpoffice/phpspreadsheet": "^1.4"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"filp/whoops": "~2.0",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "^7.5",
"symfony/css-selector": "^4.0",
"symfony/dom-crawler": "^4.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"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"
}
}
Который я изменил на -
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"laravel/framework": "5.8.*",
"intervention/image": "^2.3",
"guzzlehttp/guzzle": "^6.2",
"fideloper/proxy": "^4.0",
"laravel/cashier": "~7.0",
"codedge/laravel-fpdf": "^1.0",
"phpseclib/phpseclib": "1.0.*",
"laravelcollective/html": "~5.0",
"maatwebsite/excel": "^2.1",
"phpoffice/phpspreadsheet": "^1.4",
"laravel/tinker": "^1.0"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"fzaninotto/faker": "^1.4",
"filp/whoops": "^2.0",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.5",
"symfony/css-selector": "^4.0",
"symfony/dom-crawler": "^4.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-root-package-install": [
"php -r \"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"
]
}
}
После попытки запустить этот скрипт обновления, хотя я получаю сообщение об ошибке, похожее на это.
Package manifest generated successfully.
> post-update-cmd: Illuminate\Foundation\ComposerScripts::postUpdate
> post-update-cmd: php artisan optimize
Configuration cache cleared!
Configuration cached successfully!
Route cache cleared!
LogicException : Unable to prepare route [api/user] for serialization. Uses Closure.
at C:\Base\vendor\laravel\framework\src\Illuminate\Routing\Route.php:917
913| */
914| public function prepareForSerialization()
915| {
916| if ($this->action['uses'] instanceof Closure) {
> 917| throw new LogicException("Unable to prepare route [{$this->uri}] for serialization. Uses Closure.");
918| }
919|
920| $this->compileRoute();
921|
Exception trace:
1 Illuminate\Routing\Route::prepareForSerialization()
C:\Base\vendor\laravel\framework\src\Illuminate\Foundation\Console\RouteCacheCommand.php:62
2 Illuminate\Foundation\Console\RouteCacheCommand::handle()
C:\Base\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:32
Please use the argument -v to see more details.
Script php artisan optimize handling the post-update-cmd event returned with error code 1
Любые предложения