PHPackages                             hirodev/base-design-patterns - 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. [Database &amp; ORM](/categories/database)
4. /
5. hirodev/base-design-patterns

ActiveLibrary[Database &amp; ORM](/categories/database)

hirodev/base-design-patterns
============================

This package used to generate repositories, service, interface in laravel

v0.1.0(2y ago)084MITPHPPHP &gt;=8.1

Since Jun 16Pushed 2y agoCompare

[ Source](https://github.com/Udemy-FPT/design-patterns)[ Packagist](https://packagist.org/packages/hirodev/base-design-patterns)[ RSS](/packages/hirodev-base-design-patterns/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (5)Used By (0)

Design Patterns
===============

[](#design-patterns)

This is a package to auto generate repositories, services, interface.

\## Artisan Command List 1. [Make Repository](#Make-Repository)
2. [Make Service](#Make-Service)
3. [Make Trait](#Make-Trait)
4. [ Publish Model Repository &amp; Repository Interface](#Publish-Repository)
5. [ Publish Model Service &amp; Service Interface](#Publish-Service)

Make Repository
---------------

[](#make-repository)

**Create a repository Class.**
`php artisan make:repository your-repository-name`

Example:

```
php artisan make:repository UserRepository

```

or

```
php artisan make:repository Backend/UserRepository

```

The above will create a **Repositories** directory inside the **App** directory.

**Create a repository with Interface.**
`php artisan make:repository your-repository-name -i`

Example:

```
php artisan make:repository UserRepository -i

```

or

```
php artisan make:repository Backend/UserRepository -i

```

Here you need to put extra `-i` flag. The above will create a **Repositories** and **Interfaces** in **Repositories** folder
directory inside the **App** directory.

Make Service
------------

[](#make-service)

**Create a Service Class.**
`php artisan make:service your-service-name`

Example:

```
php artisan make:service UserService

```

or

```
php artisan make:service Backend/UserService

```

The above will create a **Services** directory inside the **App** directory.

Make Trait
----------

[](#make-trait)

**Create a Trait.**
`php artisan make:trait your-trait-name`

Example:

```
php artisan make:trait CheckAuth

```

or

```
php artisan make:trait Backend/CheckAuth

```

Publish Repository
------------------

[](#publish-repository)

**Publish Base Repository.**
`php artisan vender:publish`

All function in base repository

```
public function find(array $conditions = []);
public function findOne(array $conditions);
public function findById(int $id);
public function create(array $attributes);
public function update(Model $model, array $attributes = []);
public function save(Model $model);
public function delete(Model $model);
public function get($query);
public function destroy(array $ids);
public function findCount(array $conditions);
public function toBase($query);
public function updateMultiple(Builder $query, array $attributes = []);
public function updateOrCreate(array $attributes, array $values);
public function findAll();
public function findByIds(array $ids);
public function model();
public function makeModel();
public function resetModel();

```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

1067d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c564f279c3ebc2a13b037a0c2ec0ef5f31d2775b75d382f2d0e436864ac512a2?d=identicon)[hirodev](/maintainers/hirodev)

---

Top Contributors

[![tailt-tech](https://avatars.githubusercontent.com/u/20684497?v=4)](https://github.com/tailt-tech "tailt-tech (10 commits)")

---

Tags

eloquentrepository patternrepositoryrepositories

### Embed Badge

![Health badge](/badges/hirodev-base-design-patterns/health.svg)

```
[![Health](https://phpackages.com/badges/hirodev-base-design-patterns/health.svg)](https://phpackages.com/packages/hirodev-base-design-patterns)
```

###  Alternatives

[torann/laravel-repository

Base repository implementation for Laravel

88497.8k2](/packages/torann-laravel-repository)[czim/laravel-repository

Repository for Laravel (inspired by and indebted to Bosnadev/Repositories)

54110.0k4](/packages/czim-laravel-repository)[dannyweeks/laravel-base-repository

An abstract repository class for your Eloquent repositories that requires minimal config to get started.

202.0k](/packages/dannyweeks-laravel-base-repository)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
