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

ActiveLibrary

sagni/repository
================

This is laravel package for creating repository

1.0.3(2y ago)324MITPHPPHP ^8.0

Since Jun 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Sagni-prog/LaravelRepositoryGenetator)[ Packagist](https://packagist.org/packages/sagni/repository)[ RSS](/packages/sagni-repository/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

Table of Contents
-----------------

[](#table-of-contents)

- [Overview](#overview)
- [Installation](#installation)
    - [Requirements](#requirements)
    - [Install the Package](#install-the-package)
- [Usage](#usage)
- [Contribution](#contribution)
- [License](#license)
- [Conclusion](#conclusion)

OverView
--------

[](#overview)

This is a lightweight Laravel package designed to streamline the process of creating repositories design pattern in your projects. With this package, you can effortlessly generate the necessary files for your repository, including the concrete class, interface, and service provider.

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

[](#installation)

### Requirements

[](#requirements)

The package has been developed and tested to work with the following minimum requirements:

- PHP 8.0
- Laravel 8

### Install the Package

[](#install-the-package)

Run this command

```
composer require sagni/repository
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

To create a repository using the make:repository command, simply run:

```
php artisan make:repository User/UserRepository
```

If the Repository directory does not exist within your app directory, the command will automatically create it for you. The above command will generate the following files:

1. app/Repository/User/UserRepository.php
2. app/Repository/User/UserRepositoryInterface.php
3. app/Providers/User/UserRepositoryServiceProvider.php

If you prefer to keep the generated repository files directly in the app/Repository directory without any subdirectory, you can use the command below:

```
php artisan make:repository UserRepository
```

This command generates the same files mentioned above, but without the User subdirectory.

### Repository Class

[](#repository-class)

After generating the necessary files, you need to implement your repository logic. Open the UserRepository.php file created inside the app/Repository/User directory and modify it as needed:

```
