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

ActiveLibrary

derakht/repository-pattern
==========================

Implement repository pattern design with a command

V1.0.0(5y ago)6661MITPHP

Since Sep 21Pushed 5y ago2 watchersCompare

[ Source](https://github.com/FarhadShirmardi/laravel-repository-pattern)[ Packagist](https://packagist.org/packages/derakht/repository-pattern)[ RSS](/packages/derakht-repository-pattern/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Laravel Repository Pattern Generator
====================================

[](#laravel-repository-pattern-generator)

**Generate repository structure with single command**

This package generates repository pattern files related to a model to use them in your app.

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

[](#installation)

Require this package with composer using the following command:

```
composer require derakht/repository-pattern
```

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

[](#configuration)

Publish the configuration file with th following command.

```
php artisan vendor:publish --provider="Derakht\RepositoryPattern\RepositoryPatternServiceProvider"
```

You can change default paths in this file.

Usage
-----

[](#usage)

You can now run the below command to create repository files.

```
php artisan make:repository ModelName
```

Example
-------

[](#example)

```
php artisan make:repository Post
```

### PostController.php

[](#postcontrollerphp)

```
