When I update my project (compose update), I get the next error:
$ composer update
...
> IlluminateFoundationComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
BadMethodCallException
Method IlluminateConsoleSchedulingEvent::tap does not exist.
at vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:113
109▕ */
110▕ public function __call($method, $parameters)
111▕ {
112▕ if (! static::hasMacro($method)) {
➜ 113▕ throw new BadMethodCallException(sprintf(
114▕ 'Method %s::%s does not exist.', static::class, $method
115▕ ));
116▕ }
117▕
• Bad Method Call: Did you mean IlluminateConsoleSchedulingEvent::at() ?
+7 vendor frames
8 artisan:35
IlluminateFoundationConsoleKernel::handle()
In laravel.log we found this stacktrace:
[2024-10-23 12:33:45] production.ERROR: Method IlluminateConsoleSchedulingEvent::tap does not exist. {"exception":"[object] (BadMethodCallException(code: 0): Method Illuminate\Console\Scheduling\Event::tap does not exist. at .../vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:113)
[stacktrace]
#0 .../vendor/ralphjsmit/laravel-horizon-cron-supervisor/src/Supervisor/SupervisorServiceProvider.php(26): Illuminate\Console\Scheduling\Event->__call()
If we look at the line of code and later we go to see the Event class, we can’t find the tap method.
My compose file:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^8.1",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.3",
"inspector-apm/inspector-laravel": "^4.7",
"laravel/framework": "^8.54",
"laravel/horizon": "^5.7",
"laravel/tinker": "^2.5",
"predis/predis": "^2.1.1",
"ralphjsmit/laravel-horizon-cron-supervisor": "^1.0.1",
"tymon/jwt-auth": "dev-develop"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/breeze": "^1.6",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3"
},
"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-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
}
In summary, when running composer update, a BadMethodCallException occurs because the method tap does not exist in the IlluminateConsoleSchedulingEvent class. This issue arises from the ralphjsmit/laravel-horizon-cron-supervisor package, which calls a method that doesn’t exist in the Event class. The tap method is not part of the Laravel framework, as seen in the Event class documentation. The error trace points to a call in the SupervisorServiceProvider.php file
Has this happened to anyone else? Thanks.
2
Answers
After review the commit history of the source code file, I downgrade the library version from 1.4.0 to 1.3.0, and then no errors were reported when update the project.
Fixed in 1.4.1, thanks for reporting!