IN your service provider,
$app->make('RocketCandy\Repo\Job\JobInterface')
...isn't resolving to anything because you haven't (as far as I can see) told Laravel what class you want to implement that interface.
You need to make a second $app->bind()
call for the interface to tell Laravel what class to use when the JobInterface is type hinted in the constructor function.
$app->bind('RocketCandy\Repo\Job\JobInterface', function($app)
{
return 'Return a new class which implements JobInterface';
});
Many thanks Chris. The issue was actually in my RepoServiceProvider file (page 40 in your book). I'd attempted to implement the interface but rather unsuccessfully:
use Job;
use RocketCandy\Repo\Job\EloquentJob;
use Illuminate\Support\ServiceProvider;
class RepoServiceProvider extends ServiceProvider {
public function register()
{
$app = $this->app;
$app->bind('RocketCandy\Repo\Job\JobInterface', function($app)
{
$job = new EloquentJob(
new Job
);
});
}
}
Foolishly I should have have been RETURNING new EloquentJob instead of using the $job variable. Highly embarrassing but thanks for you help!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community