{"id":"923e6265ef9cae32","repo":"laravel/framework","slug":"method-s-s-does-not-exist","errorCode":null,"errorMessage":"Method %s::%s does not exist.","messagePattern":"Method (.+?)::(.+?) does not exist\\.","errorType":"exception","errorClass":"BadMethodCallException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Console/Scheduling/Schedule.php","lineNumber":542,"sourceCode":"     * @return mixed\n     *\n     * @throws \\BadMethodCallException\n     */\n    public function __call($method, $parameters)\n    {\n        if (static::hasMacro($method)) {\n            return $this->macroCall($method, $parameters);\n        }\n\n        if (method_exists(PendingEventAttributes::class, $method)\n            || in_array($method, PendingEventAttributes::DEFERRED_EVENT_METHODS, true)\n            || Event::hasMacro($method)) {\n            $this->attributes ??= $this->groupStack ? clone array_last($this->groupStack) : new PendingEventAttributes($this);\n\n            return $this->attributes->$method(...$parameters);\n        }\n\n        throw new BadMethodCallException(sprintf(\n            'Method %s::%s does not exist.', static::class, $method\n        ));\n    }\n}\n","sourceCodeStart":524,"sourceCodeEnd":547,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Console/Scheduling/Schedule.php#L524-L547","documentation":"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.","triggerScenarios":"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.","commonSituations":"Typos in fluent scheduling calls; using a method that was removed in a framework upgrade; relying on a macro that's only registered conditionally.","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."],"exampleFix":"// before\n$schedule->command('reports:send')->houly();  // typo\n\n// after\n$schedule->command('reports:send')->hourly();","handlingStrategy":"try-catch","validationCode":"$method = 'houly';\n$valid = get_class_methods(\\Illuminate\\Console\\Scheduling\\PendingEventAttributes::class);\nif (! in_array($method, $valid, true) && ! \\Illuminate\\Console\\Scheduling\\Schedule::hasMacro($method)) {\n    // reject or correct the typo\n}","typeGuard":"function scheduleMethodExists(string $m): bool\n{\n    return \\Illuminate\\Console\\Scheduling\\Schedule::hasMacro($m)\n        || method_exists(\\Illuminate\\Console\\Scheduling\\PendingEventAttributes::class, $m);\n}","tryCatchPattern":"try {\n    $schedule->command('x')->$method();\n} catch (\\BadMethodCallException $e) {\n    // log and surface a clear typo hint\n}","preventionTips":["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."],"tags":["scheduling","console","api-misuse","typo","laravel"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}