PHPackages                             thalles/repositories-commands - 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. thalles/repositories-commands

ActiveLibrary

thalles/repositories-commands
=============================

Artisan commands to create repositories

v1.0.4(5y ago)137MITPHPPHP &gt;=7.1.3

Since Apr 7Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ThallesTeodoro/LaravelRepositories)[ Packagist](https://packagist.org/packages/thalles/repositories-commands)[ RSS](/packages/thalles-repositories-commands/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

LaravelRepositories
===================

[](#laravelrepositories)

Artisan commands to create repositories
---------------------------------------

[](#artisan-commands-to-create-repositories)

This package provides an easy way to quickly setup and create a Repository using Unit Of Work Pattern.

1. [Requirements](#1-requirements)
2. [Installation](#2-installation)
3. [Configuration](#3-configuration)
4. [Usage](#4-usage)
5. [Default Repository Methods](#5-default-repository-methods)
6. [Unit Of Work methods](#6-unit-of-work-methods)

### **1. Requirements**

[](#1-requirements)

- PHP &gt;= 7.1.3
- laravel/framework ^5.8

---

### **2. Installation**

[](#2-installation)

Require the package using composer:

```
composer require thalles/repositories-commands

```

### **3. Configuration**

[](#3-configuration)

Run the following command to create the main Repository and Interface for this repository.

```
php artisan repository:setup

```

> Pay attention to the terminal output. You will need to copy the output and paste on register method of AppServiceProvider.

### **4. Usage**

[](#4-usage)

To create a new repository, use the following command.

```
php artisan repository:new RepositoryName ModelName

```

> The fisrt argument is the repository name. The second is the model that you want to use. If your model was not on default path, you can inform the path to file.

Exemple:

```
php artisan repository:new UserRepository Models/User

```

Add the repository attribute to the UnitOfWork class.

```
