Support the ongoing development of Laravel.io →
Eloquent IOC
Last updated 1 year ago.
0

If you are inject module to your class, where are you storing it? I see you are calling

$this->module

but there's no 'module' property in you class, maybe you are just missing?

protected $module;

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.

Last updated 1 year ago.
0

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.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.