我正在尝试在Laravel 8中实现自动备份。我决定使用Laravel-backup包"spatie/laravel-backup"。
问题出现在我尝试用"composer require spatie/laravel-backup"安装该包时。
我遇到了这个问题:
问题1 - spatie/laravel-backup[8.1.0, ..., v8.x-dev]要求illuminate/console ^9.0,但找到的是illuminate/console[v9.0.0-beta.1, ..., 9.x-dev],但这些没有加载,可能是因为与另一个要求冲突了。-根composer.json要求spatie/laravel-backup ^8.1 -> 可以满足spatie/laravel-backup[8.1.0, 8.1.1, 8.1.2, v8.x-dev]。
我尝试运行类似问题答案中的这些命令,但没有改变:
-composer require spatie/laravel-backup "^8.1" --ignore-platform-reqs
-composer require spatie/laravel-medialibrary
我还尝试删除vendor和composer.lock,然后运行composer install,但问题仍然存在。
我猜我的composer.json文件有问题:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"ext-gd": "*",
"ext-json": "*",
"aws/aws-sdk-php": "~3.0",
"darkaonline/l5-swagger": "^8.1",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.75",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5",
"league/flysystem-aws-s3-v3": "^1.0",
"maatwebsite/excel": "^3.1",
"tymon/jwt-auth": "^1.0",
"ext-pdo": "*"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^5.10",
"phpunit/phpunit": "^9.5.10"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
感谢大家抽出时间来查看我的问题。:))
composer require spatie/laravel-backup:7.0
吗?这是 Laravel 8 的正确版本。 - Manuel Glez