Laravel Error: Object of type Illuminate\Console\Scheduling\Event is not callable

Another day, another really fun error that no one but me seems to have ever suffered in production.
For me, this error was caused by missing extra parentheses on the scheduled call.
$schedule->command('twilio:get')->dailyAt('20:00')();
Stack trace of the error:
[2022-02-25 16:31:01] live.ERROR: Object of type Illuminate\Console\Scheduling\Event is not callable {"exception":"[object] (Error(code: 0): Object of type Illuminate\\Console\\Scheduling\\Event is not callable at /var/www/202202252328/app/Console/Kernel.php:104)
[stacktrace]
#0 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(102): App\\Console\\Kernel->schedule()
#1 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Support/helpers.php(263): Illuminate\\Foundation\\Console\\Kernel->Illuminate\\Foundation\\Console\\{closure}()
#2 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(103): tap()
#3 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Container/Container.php(873): Illuminate\\Foundation\\Console\\Kernel->Illuminate\\Foundation\\Console\\{closure}()
#4 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\\Container\\Container->build()
#5 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(851): Illuminate\\Container\\Container->resolve()
#6 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\\Foundation\\Application->resolve()
#7 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(836): Illuminate\\Container\\Container->make()
#8 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(182): Illuminate\\Foundation\\Application->make()
#9 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(124): Illuminate\\Container\\BoundMethod::addDependencyForCallParameter()
#10 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Container\\BoundMethod::getMethodDependencies()
#11 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#12 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#13 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod()
#14 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\\Container\\BoundMethod::call()
#15 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\\Container\\Container->call()
#16 /var/www/202202252328/vendor/symfony/console/Command/Command.php(298): Illuminate\\Console\\Command->execute()
#17 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\\Component\\Console\\Command\\Command->run()
#18 /var/www/202202252328/vendor/symfony/console/Application.php(1015): Illuminate\\Console\\Command->run()
#19 /var/www/202202252328/vendor/symfony/console/Application.php(299): Symfony\\Component\\Console\\Application->doRunCommand()
#20 /var/www/202202252328/vendor/symfony/console/Application.php(171): Symfony\\Component\\Console\\Application->doRun()
#21 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Console/Application.php(94): Symfony\\Component\\Console\\Application->run()
#22 /var/www/202202252328/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run()
#23 /var/www/202202252328/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle()
#24 {main}
"}
About the author
- Guy Warner is a Salt Lake City software engineer with 20+ years building PHP/MySQL/AWS SaaS products, with 10+ years of Laravel in production. He was Chief Technology Officer (CTO) and VP of Development at Monitorbase in credit monitoring, handling 7M+ monthly queries, where he led 12+ developers and migrated to SingleStore. He founded Eco Moving Utah, a moving tote rental business, and builds Bin X, rental business software. He has a B.S. in Political Science, University of Utah.
Comments
Join the discussionNo comments yet. Be the first to comment.


