Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
agungsugiarto committed Aug 16, 2020
2 parents b843077 + ab93d2f commit 040e6e3
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CodeIgniter4 Repository Pattern
>Implementation of repository pattern for CodeIgniter 4. The package allows out-of-the-box filtering of data based on parameters in the <b>request</b>, and also allows you to quickly integrate the list filters and custom criteria.

[![Latest Stable Version](https://poser.pugx.org/agungsugiarto/codeigniter4-repository/v)](//packagist.org/packages/agungsugiarto/codeigniter4-repository)
[![Total Downloads](https://poser.pugx.org/agungsugiarto/codeigniter4-repository/downloads)](//packagist.org/packages/agungsugiarto/codeigniter4-repository)
[![Latest Unstable Version](https://poser.pugx.org/agungsugiarto/codeigniter4-repository/v/unstable)](//packagist.org/packages/agungsugiarto/codeigniter4-repository)
[![License](https://poser.pugx.org/agungsugiarto/codeigniter4-repository/license)](//packagist.org/packages/agungsugiarto/codeigniter4-repository)

## About
Implementation of repository pattern for CodeIgniter 4. The package allows out-of-the-box filtering of data based on parameters in the request, and also allows you to quickly integrate the list filters and custom criteria.

## Table of Contents

Expand Down Expand Up @@ -100,7 +107,7 @@ Extend it from `Fluent\Repository\Eloquent\BaseRepository` and provide `entity()
```php
namespace App;

use AwesIO\Repository\Eloquent\BaseRepository;
use Fluent\Repository\Eloquent\BaseRepository;

class NewsRepository extends BaseRepository
{
Expand Down Expand Up @@ -173,13 +180,13 @@ $news = $this->news->orderBy('title', 'desc')->get();
Save a new model and return the instance:

```php
$news = $this->news->create($request->all());
$news = $this->news->create($this->request->getVar());
```

Update a record:

```php
$this->news->update($request->all(), $id);
$this->news->update($this->request->getVar(), $id);
```

Delete a record by id:
Expand All @@ -195,8 +202,8 @@ Criteria are a way to build up specific query conditions.
```php
use Fluent\Repository\Contracts\CriterionInterface;

class MyCriteria implements CriterionInterface {

class MyCriteria implements CriterionInterface
{
protected $conditions;

public function __construct(array $conditions)
Expand Down

0 comments on commit 040e6e3

Please sign in to comment.