laravel/framework · error · BadMethodCallException
Method %s::%s does not exist.
Error message
Method %s::%s does not exist.
What it means
Thrown by Schedule::__call() (src/Illuminate/Console/Scheduling/Schedule.php:542) when the called method is not a registered macro, not a method on PendingEventAttributes, not in PendingEventAttributes::DEFERRED_EVENT_METHODS, and not an Event macro. Schedule is macroable and forwards to PendingEventAttributes; anything else triggers BadMethodCallException.
Source
Thrown at src/Illuminate/Console/Scheduling/Schedule.php:542
* @return mixed
*
* @throws \BadMethodCallException
*/
public function __call($method, $parameters)
{
if (static::hasMacro($method)) {
return $this->macroCall($method, $parameters);
}
if (method_exists(PendingEventAttributes::class, $method)
|| in_array($method, PendingEventAttributes::DEFERRED_EVENT_METHODS, true)
|| Event::hasMacro($method)) {
$this->attributes ??= $this->groupStack ? clone array_last($this->groupStack) : new PendingEventAttributes($this);
return $this->attributes->$method(...$parameters);
}
throw new BadMethodCallException(sprintf(
'Method %s::%s does not exist.', static::class, $method
));
}
}
View on GitHub (pinned to bd6b5437e6)
Solutions
- Check spelling against the docs / PendingEventAttributes source for valid frequency/option methods.
- Register the intended behavior as a Schedule macro: Schedule::macro('foo', fn () => ...).
- On version upgrades, grep the upgrade guide for removed scheduling methods.
- Use an IDE stubs package (laravel-ide-helper) for autocompletion.
Example fix
// before
$schedule->command('reports:send')->houly(); // typo
// after
$schedule->command('reports:send')->hourly(); Defensive patterns
Strategy: try-catch
Validate before calling
$method = 'houly';
$valid = get_class_methods(\Illuminate\Console\Scheduling\PendingEventAttributes::class);
if (! in_array($method, $valid, true) && ! \Illuminate\Console\Scheduling\Schedule::hasMacro($method)) {
// reject or correct the typo
} Type guard
function scheduleMethodExists(string $m): bool
{
return \Illuminate\Console\Scheduling\Schedule::hasMacro($m)
|| method_exists(\Illuminate\Console\Scheduling\PendingEventAttributes::class, $m);
} Try / catch
try {
$schedule->command('x')->$method();
} catch (\BadMethodCallException $e) {
// log and surface a clear typo hint
} Prevention
- Use IDE stubs (barryvdh/laravel-ide-helper) for autocompletion.
- Lint scheduling DSL calls against PendingEventAttributes methods in CI.
- Check upgrade guides when bumping Laravel majors.
When it happens
Trigger: Calling $schedule->someTypo() or a method name that doesn't exist on PendingEventAttributes (e.g. $schedule->houly(), $schedule->runInBackround()). Also removed/renamed methods across version upgrades.
Common situations: Typos in fluent scheduling calls; using a method that was removed in a framework upgrade; relying on a macro that's only registered conditionally.
Related errors
- Invoke an attribute method such as Schedule::daily() before
- Invalid scheduled callback event. Must be a string or callab
- Scheduled closures can not be run in the background.
- A scheduled event name is required to prevent overlapping. U
- A scheduled event name is required to only run on one server
AI-assisted analysis of laravel/framework@bd6b5437e6 (2026-08-06).
Data as JSON: /data/errors/923e6265ef9cae32.json.
Report an issue: GitHub.