PHPackages                             yaza/laravel-repository-service - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. yaza/laravel-repository-service

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yaza/laravel-repository-service
===============================

Simple repository, service pattern for laravel

V6.0.1(1y ago)14337.9k—0%34[1 PRs](https://github.com/yaza-putu/laravel-repository-with-service/pulls)2MITPHPPHP ^8.2

Since Oct 28Pushed 1y ago2 watchersCompare

[ Source](https://github.com/yaza-putu/laravel-repository-with-service)[ Packagist](https://packagist.org/packages/yaza/laravel-repository-service)[ Docs](https://github.com/yaza-putu/laravel-repository-with-service.git)[ RSS](/packages/yaza-laravel-repository-service/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (39)Used By (2)

Simple repository pattern for laravel, with services!
=====================================================

[](#simple-repository-pattern-for-laravel-with-services)

With easy repository, you can have the power of the repository pattern, without having to write too much code altogether. The package automatically binds the interfaces to the implementations, all you have to do is change in the configuration which implementation is being used at the moment!

Requirement
-----------

[](#requirement)

- Minimum PHP ^8.2

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

[](#installation)

You can install the package via composer for latest version

```
$ composer require yaza/laravel-repository-service
```

Specific Version :

Laravel VersionPackage Version126.x115.x104.093.2```
# for laravel 11
$ composer require yaza/laravel-repository-service:"^5.0"
```

Publish the config file with (Important):

```
php artisan vendor:publish --provider="LaravelEasyRepository\LaravelEasyRepositoryServiceProvider" --tag="easy-repository-config"
```

Quick usage
-----------

[](#quick-usage)

You can also create only the repository, or service, or both with artisan:

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

// or create together with a service
php artisan make:repository User --service
// or
php artisan make:repository UserRepository --service

// or create a service separately
php artisan make:service User
// or
php artisan make:service UserService
// or
php artisan make:service UserService --repository

// create service with blank template
php artisan make:service UserService --blank
```

How to change bind interface to new class implementation
--------------------------------------------------------

[](#how-to-change-bind-interface-to-new-class-implementation)

Add this config to AppServiceProvider :

```
$this->app->extend(Interface::class, function ($service, $app) {
    return new NewImplement($service);
});
```

Documentation
=============

[](#documentation)

Note : When you create service the default used api template,in api template use setter getter data inside service for how to use you can look in src/Traits/ResultService.php, if you need blank template when create service, you need add argument --blank, ex : php artisan make:service User --blank.

example setter getter service with api template

```
// getter (on service called)
$serviceName->getData()
$serviceName->getCode()
$serviceName->getMessage()
$serviceName->getError()
// setter (in service)
$this->setCode()
$this->setData()
$this->setError()
$this->setMessage()
```

More details will be explained in docs version 6.

Go to guide [Docs V6](https://yaza-putu.github.io/laravel-service-repository-pattern-guide/)

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

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

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance45

Moderate activity, may be stable

Popularity47

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 98.6% 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 ~34 days

Recently: every ~84 days

Total

37

Last Release

428d ago

Major Versions

V1.5.15 → V2.0.02022-04-20

V2.1.2 → V3.2.12022-07-08

V3.2.7 → V4.0.02023-02-26

V4.0.0 → V5.0.02024-04-14

V5.1.0 → V6.0.02025-03-12

PHP version history (5 changes)V1.1.2PHP ^7.4|^8.0

V2.0.0PHP ^8.0|^8.1

V4.0.0PHP ^8.1

V5.0.0PHP ^8.2

V6.0.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/37f00f8a1d0ca01c4232359f171fe2d47269b94cbb1f1040e7b6cf341938a14c?d=identicon)[yaza](/maintainers/yaza)

---

Top Contributors

[![yaza-putu](https://avatars.githubusercontent.com/u/59905886?v=4)](https://github.com/yaza-putu "yaza-putu (143 commits)")[![BadJacky](https://avatars.githubusercontent.com/u/113529280?v=4)](https://github.com/BadJacky "BadJacky (1 commits)")[![yasa32putu](https://avatars.githubusercontent.com/u/169970895?v=4)](https://github.com/yasa32putu "yasa32putu (1 commits)")

---

Tags

laravel-repositorylaravel-repository-patternlaravel-repository-servicelaravel-servicelaravellaravel-repositorylaravel-repository-service

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/yaza-laravel-repository-service/health.svg)

```
[![Health](https://phpackages.com/badges/yaza-laravel-repository-service/health.svg)](https://phpackages.com/packages/yaza-laravel-repository-service)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

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