I have a simply Project repo with a Project interface. I use this in my controllers just fine. However, when trying to inject into a job, I get an error:
Argument 1 passed to App\Jobs\Project::setVariables() must implement interface App\Repositories\Contracts\Project, none given, called in /vagrant/site/app/Jobs/Project.php on line 103 and defined', '/vagrant/site/app/Jobs/Project.php', '78', array()) in Project.php line 78
Seems strange if you can't use dependencies inside a job.
Well, figured out that injection can't be used in the methods of a job. If used in the construct or handle method, they work.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community