PHPackages                             lanidev/repository-pattern - 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. lanidev/repository-pattern

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

lanidev/repository-pattern
==========================

Laravel package with improvements by repository pattern

07PHP

Since May 2Pushed 7y agoCompare

[ Source](https://github.com/Lanidev/repository-pattern)[ Packagist](https://packagist.org/packages/lanidev/repository-pattern)[ RSS](/packages/lanidev-repository-pattern/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Lanidev / repository-pattern
============================

[](#lanidev--repository-pattern)

Laravel package with improvement to framework by using repository pattern. This package will provides you some new command to generate code and the repository pattern will make your applications easier to maintain.

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

[](#installation)

Run the following command from your terminal:

```
composer require lanidev/repository-pattern
```

Configuration
-------------

[](#configuration)

Run the following command from your terminal:

```
php artisan vendor:publish --provider="Lanidev\Pattern\Providers\ConfigServiceProvider"
```

This will generate a file : `config/pattern.php`

In this file you can modify the namespace of models and repositories for the file generator

```
return [
    'namespace'  => [
        'model'       => 'App',
        'repository'  => 'App\Repositories'
    ]
];
```

Console usage
-------------

[](#console-usage)

This package provides an updated version of the command `php artisan make:model` with a new option : `--repository`

#### Recommended way

[](#recommended-way)

Run the following command from your terminal

```
php artisan make:model Page --repository
```

This will generate a classic model in the folder with the namespace choosen in the config file

```
