I'm a bit of a newbie to PHP in general and the common solutions such as running composer update and other similar suggestions such as the ones featured in this post didn't work. Here is the complete error message when I try to run '''composer update'''
'''> Illuminate\Foundation\ComposerScripts::postAutoloadDump
@php artisan package:discover --ansi
In Finder.php line 640:
The "" directory does not exist.
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1'''
I suppose my not really knowing composer well does not help. I believe a path is missing to some folder or file in a config or .env file somewhere.
Here is the boilerplate's composer.json file I am starting with:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^8.1",
"guzzlehttp/guzzle": "^7.5",
"laravel/framework": "^10.3.2",
"laravel/sanctum": "^3.2.1",
"laravel/tinker": "*",
"phpoffice/phpspreadsheet": "^1.29"
},
"require-dev": {
"fakerphp/faker": "^1.21.0",
"laravel/pint": "^1.6",
"laravel/sail": "^1.21.2",
"mockery/mockery": "^1.5.1",
"nunomaduro/collision": "^7.1",
"phpunit/phpunit": "^10.0.15",
"spatie/laravel-ignition": "^2.0"
},
"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": [ "laravel/dusk"]
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true
}
},
"minimum-stability": "stable",
"prefer-stable": true
}