Support the ongoing development of →
IOC Forms Validation
Last updated 2 years ago.

IN your service provider,


...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';
Last updated 9 years ago.

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!


Your banner here too?

olimorris olimorris Joined 31 Dec 2014


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

Your logo here?

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

© 2024 - All rights reserved.