Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/morilog/flexible-repository

Reposiotry Pattern implemention for PHP (inc: Laravel, Symfony, ...)
https://github.com/morilog/flexible-repository

ddd doctrine eloquent eloquent-orm-models laravel php repository-pattern symfony

Last synced: 16 days ago
JSON representation

Reposiotry Pattern implemention for PHP (inc: Laravel, Symfony, ...)

Awesome Lists containing this project

README

        

# Laravel Flexible Repository
A Laravel package for creating Flexible and powerful repositories

## Installation
```shell
composer require morilog/flexible-repository
```

## Usage

### Create Repositories

#### Create for Eloquent
- Create an `interface` for your repository that extended from `Morilog\FlexibleRepository\Contracts\RepositoryInterface`

```php
app->bind(UserRepository::class, function ($app) {
return new EloquentUserRepository($app);
});

// or
// $this->app->bind(UserRepository::class, EloquentUserRepository::class);

}
}
```

- Inject your repository in classes and controller methods
```php
all();
}
}

```