PHPackages                             antoiner/laravel-repositories-command - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. antoiner/laravel-repositories-command

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

antoiner/laravel-repositories-command
=====================================

Command for Laravel to generate repositories of each model

01PHP

Since Mar 1Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Antoine68/laravel-repositories-command)[ Packagist](https://packagist.org/packages/antoiner/laravel-repositories-command)[ RSS](/packages/antoiner-laravel-repositories-command/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Repositories Command
============================

[](#laravel-repositories-command)

Artisan command to create Repository with RepositoryInterface for each Model and use it in the application with the dependency injection.

Installation
------------

[](#installation)

Require package with composer :

```
composer require antoiner/laravel-repositories-command --dev

```

Command
-------

[](#command)

Once installed run the following command to create RepositoryInterface and Repository for each Model of your application :

```
php artisan make:repositories

```

This command also create RepositoryServiceProvider to bind all RepositoryInterface with its correspondent Repository .

After executing the command you just have to add this line in the `config/app.php` to register the service provider :

```
App\Providers\RepositoryServiceProvider::class,
```

Usage
-----

[](#usage)

Now you can use Repository in your application like this :

```
//routes/web.php
