« first day  last day (15 days later) » 

9:04 AM
Sorry for not getting back to you about this, was tied up at work. The reason you can only use method binding in a job is because of the way the job class is instantiated.

When you call Job::dispatch($parameter), the dispatch method will create a new instance of the job via the new keyword, using the same paramters passed to the dispatch method (new Job($parameter)). It will also determine if the job should be added to a queue or handled synchronously.

In order for dependencies to be injected via the constructor, the class must be instantiated via the service container, i.e app()->make(Jo
@KKK hope the above helps, my advice to you would be to not go down the path of trying to follow every programming principal in the book. Often times unnecessary usage of the service container can be an antipattern, as long as your code is testable and easy to read / maintain, you won't make life harder for yourself :)
 
 
10 hours later…
KKK
6:58 PM
Thanks for advice.
 

« first day  last day (15 days later) »