每当我尝试在全新的Laravel环境中使用composer安装“ unisharp / laravel-filemanager”时,都会遇到以下问题。
要重现这一点,我要做的就是运行以下命令来设置一个新的Laravel项目...
composer global require laravel/installer
laravel new MyNewLaravelWebsite
cd MyNewLaravelWebsite
composer require unisharp/laravel-filemanager
无论出于何种原因,如果我只是在MyNewLaravelWebsite文件夹之外运行“ composer require unisharp / laravel-filemanager”,则该命令有效,但不适用于我的Laravel项目(显然)...
我的PHP版本是7.4.3。这也是我的composer.json ...
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0"
},
"require-dev": {
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"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-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}
答案 0 :(得分:2)
我发现该软件包的1.9.2版本提供了对Laravel 7 / 7.3的支持。因此,我没有安装2.0,而是安装了1.9.2,并且可以正常工作。。。我猜测稍后将在版本2的软件包中提供对Laravel 7的支持。...这是要求正确软件包的方法。
composer require unisharp/laravel-filemanager 1.9.2
希望这对某人有帮助。