If you are inject module to your class, where are you storing it? I see you are calling
but there's no 'module' property in you class, maybe you are just missing?
Also, are you trying to use Laravel's automatic dependency injection? Because if you are, how is Laravel supposed to know what to inject into the constructor? You need to specify what you expect to be injected, for example:
public function __construct(Module $module)
That way Laravel knows what you need and injects the instance for you.
Hope this helps
P.S: In your run function you don't need to assign the module property to a local variable so you could just run
$connection = Connection::find($this->module->connection_id);
Given that your class has a $module property like I pointed before.
After some deep diving, I believe the issue is around a previous call of $worker->start();.
I'm trying to implement pthreads in Laravel and it looks like the $worker->start(); call kills all of the model/controller functionality throughout the application.
I'll have to dig into this some more.
Thanks for the tips on better formatting of the Class delcaration, though.
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us
The Laravel portal for problem solving, knowledge sharing and community building.