After the project setup tried to run the artisan serve
command and got the following exception:
In PackageManifest.php line 130:
Call to undefined method Illuminate\Support\Collection::mapWithKeys()
I tried to run the Laravel server locally
UPD:
laravel.log
[2022-12-31 10:46:59] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (Error(code: 0): Call to undefined method Illuminate\\Support\\Collection::flatMap() at vendor/laravel/framework/src/Illuminate/Log/LogManager.php:252)
[stacktrace]
#0 vendor/laravel/framework/src/Illuminate/Log/LogManager.php(210): Illuminate\\Log\\LogManager->createStackDriver()
#1 vendor/laravel/framework/src/Illuminate/Log/LogManager.php(125): Illuminate\\Log\\LogManager->resolve()
#2 vendor/laravel/framework/src/Illuminate/Log/LogManager.php(112): Illuminate\\Log\\LogManager->get()
#3 vendor/laravel/framework/src/Illuminate/Log/LogManager.php(590): Illuminate\\Log\\LogManager->driver()
#4 vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(252): Illuminate\\Log\\LogManager->error()
#5 app/Exceptions/Handler.php(53): Illuminate\\Foundation\\Exceptions\\Handler->report()
#6 vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(366): App\\Exceptions\\Handler->report()
#7 vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(131): Illuminate\\Foundation\\Console\\Kernel->reportException()
#8 artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle()
#9 {main}
"}
[2022-12-31 10:46:59] laravel.ERROR: Call to undefined method Illuminate\Support\Collection::mapWithKeys() {"exception":"[object] (Error(code: 0): Call to undefined method Illuminate\\Support\\Collection::mapWithKeys() at vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php:130)
[stacktrace]
#0 vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(106): Illuminate\\Foundation\\PackageManifest->build()
#1 vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(89): Illuminate\\Foundation\\PackageManifest->getManifest()
#2 vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(78): Illuminate\\Foundation\\PackageManifest->config()
#3 vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php(26): Illuminate\\Foundation\\PackageManifest->aliases()
#4 vendor/laravel/framework/src/Illuminate/Foundation/Application.php(237): Illuminate\\Foundation\\Bootstrap\\RegisterFacades->bootstrap()
#5 vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(310): Illuminate\\Foundation\\Application->bootstrapWith()
#6 vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(127): Illuminate\\Foundation\\Console\\Kernel->bootstrap()
#7 artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle()
#8 {main}
"}
PackageManifest.php
$this->write(collect($packages)->mapWithKeys(function ($package) {
return [$this->format($package['name']) => $package['extra']['laravel'] ?? []];
})->each(function ($configuration) use (&$ignore) {
$ignore = array_merge($ignore, $configuration['dont-discover'] ?? []);
})->reject(function ($configuration, $package) use ($ignore, $ignoreAll) {
return $ignoreAll || in_array($package, $ignore);
})->filter()->all());
CodePudding user response:
I solved the problem:
- Deleted project
- Cloned from repo again
- Removed not available package
- Ran
composer update
- Ran
php artisan serve
and it worked