I try to add https://github.com/Superbalist/laravel-google-cloud-storage to my Laravel 9 and got error :
$ composer require superbalist/laravel-google-cloud-storage
Using version ^2.2 for superbalist/laravel-google-cloud-storage
./composer.json has been updated
Running composer update superbalist/laravel-google-cloud-storage
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- superbalist/laravel-google-cloud-storage[2.2.0, ..., 2.2.1] require illuminate/support ^5.1|^5.2|^5.3 -> found illuminate/support[v5.1.1, ..., 5.8.x-dev] but these were not loaded, likely because it conflicts with another require.
- superbalist/laravel-google-cloud-storage 2.2.2 requires illuminate/support ^5.1|^6.0 -> found illuminate/support[v5.1.1, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev] but these were not loaded, likely because it conflicts with another require.
- superbalist/laravel-google-cloud-storage 2.2.3 requires illuminate/support ^5.1|^6.0|^7.0 -> found illuminate/support[v5.1.1, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but these were not loaded, likely because it conflicts with another require.
- superbalist/laravel-google-cloud-storage 2.2.4 requires illuminate/support ^5.1|^6.0|^7.0|^8.0 -> found illuminate/support[v5.1.1, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires superbalist/laravel-google-cloud-storage ^2.2 -> satisfiable by superbalist/laravel-google-cloud-storage[2.2.0, ..., 2.2.4].
You can also try re-running composer require with an explicit version constraint, e.g. "composer require superbalist/laravel-google-cloud-storage:*" to figure out if any version is installable, or "composer require superbalist/laravel-google-cloud-storage:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
I check my composer.json and see that it has no any illuminate/support ref :
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^8.0.2",
"bensampo/laravel-enum": "^5.3",
"beyondcode/laravel-websockets": "^1.13",
"guzzlehttp/guzzle": "^7.2",
"inertiajs/inertia-laravel": "^0.5.2",
"laravel/framework": "^9.11",
"laravel/jetstream": "^2.8",
"laravel/sanctum": "^2.14.1",
"laravel/telescope": "^4.9",
"laravel/tinker": "^2.7",
"sentry/sentry-laravel": "^2.12",
"spatie/laravel-medialibrary": "^10.0.0",
"spatie/laravel-permission": "^5.5",
"tightenco/ziggy": "^1.0"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^1.0"
},
"autoload": {
"files": [
"app/Library/helper.php"
],
"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
}
Can I install laravel-google-cloud-storageinto this project ?
Thanks!
CodePudding user response:
illuminate/support
is part of Laravel. To make package development easier (and allow smaller parts of the framework to be used without the full framework), individual parts of Laravel can be specified as dependencies with the names illuminate/...
.
This error is saying that the maximum supported version of Laravel for this package is 8.x, but you are using 9.x for your application.
You cannot install this package in your application unless it is updated to support Laravel 9.x. If you look at this PR which talks about adding 9.x support, you will see that there does not seem to be any plan to do that any time soon (if ever). Other users recommend switching to this alternative package instead.