This is a continuation of my previous post:

You might want to check my previous post about php interface before proceeding.

Let's create a repository interface for the post. Let's call it PostRepositoryInterface.php. As you can see, this repository class implemented our PostRepository that we created .

Now, we need to create RepositoryServiceProvider and bind PostRepositoryInterface.

Then register it to the AppServiceProvider.

Check the Eloquent Interface implementation at