PHPackages                             mitul456/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. mitul456/laravel-repository-service

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

mitul456/laravel-repository-service
===================================

A Laravel package to generate repository and service layers using artisan commands

1.0.7(1mo ago)019MITPHPPHP ^8.2

Since Apr 3Pushed 1mo agoCompare

[ Source](https://github.com/mitul456/laravel-repository-service)[ Packagist](https://packagist.org/packages/mitul456/laravel-repository-service)[ RSS](/packages/mitul456-laravel-repository-service/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (9)Used By (0)

Laravel Repository &amp; Service Pattern Package
================================================

[](#laravel-repository--service-pattern-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c9dba76990a2de4ac6c401ae773b7edd5b7f616c87cd9bdda5b3a47530f1587f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6974756c3435362f6c61726176656c2d7265706f7369746f72792d736572766963652e737667)](https://packagist.org/packages/mitul456/laravel-repository-service)[![Total Downloads](https://camo.githubusercontent.com/7394e1eb01c935a149d864f844fff8c28d2d0817fd4d0e2a01138a26e9e1ffc3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6974756c3435362f6c61726176656c2d7265706f7369746f72792d736572766963652e737667)](https://packagist.org/packages/mitul456/laravel-repository-service)[![License](https://camo.githubusercontent.com/dbf53b3c4a62194cc3ec2cec53c736a6ac1d6deef90843b016ca24772610c4e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6974756c3435362f6c61726176656c2d7265706f7369746f72792d736572766963652e737667)](https://github.com/mitul456/laravel-repository-service/blob/main/LICENSE)[![PHP Version](https://camo.githubusercontent.com/b0121160ca44aa0fae4dd209a958cb6b4baa0e6237ad7598728863ac24370170/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d6974756c3435362f6c61726176656c2d7265706f7369746f72792d736572766963652e737667)](https://packagist.org/packages/mitul456/laravel-repository-service)

A powerful Laravel package to automatically generate **Repository** and **Service** layers, helping you build clean, maintainable, and testable applications.

> 🇧🇩 বাংলা: এটি একটি Laravel প্যাকেজ যা Repository Pattern এবং Service Layer স্বয়ংক্রিয়ভাবে তৈরি করে, আপনার কোডকে আরও ক্লিন এবং মেইন্টেইনেবল করে তোলে।

---

⚡ Quick Start
-------------

[](#-quick-start)

Install the package via Composer:

```
composer require mitul456/laravel-repository-service

php artisan make:repository UserRepository
php artisan make:service UserService
```

---

✨ Features
----------

[](#-features)

- 🚀 Auto generate Repository and Service classes
- 📦 Base repository trait with common CRUD operations
- 🔧 Generate Repository or Service separately
- 💉 Dependency Injection ready
- 📝 Configurable namespaces and paths
- 🎯 PSR-4 compliant
- 🎨 Clean architecture friendly

---

🤔 Why use this package?
-----------------------

[](#-why-use-this-package)

- Keep controllers clean and focused
- Separate business logic from controllers
- Improve code maintainability
- Make testing easier
- Follow clean architecture principles

---

📋 Requirements
--------------

[](#-requirements)

- PHP ^8.0 or higher
- Laravel ^10.0 or ^11.0
- Composer

---

🔧 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require mitul456/laravel-repository-service
```

### Auto Discovery

[](#auto-discovery)

This package supports Laravel auto-discovery. No need to manually register any service provider.

---

⚙️ Configuration
----------------

[](#️-configuration)

If you want to customize namespaces or paths, publish the config file:

```
php artisan vendor:publish --tag=repository-service-config
```

---

🚀 Usage
-------

[](#-usage)

### 1. Create Repository and Service Together

[](#1-create-repository-and-service-together)

```
php artisan make:repository-service User
```

---

📌 Example Usage
---------------

[](#-example-usage)

### Repository Example

[](#repository-example)

```
class UserRepository
{
    public function getAll()
    {
        return User::all();
    }
}
```

---

### Service Example

[](#service-example)

```
class UserService
{
    protected $repository;

    public function __construct(UserRepository $repository)
    {
        $this->repository = $repository;
    }

    public function getUsers()
    {
        return $this->repository->getAll();
    }
}
```

---

### Controller Example

[](#controller-example)

```
class UserController extends Controller
{
    protected $service;

    public function __construct(UserService $service)
    {
        $this->service = $service;
    }

    public function index()
    {
        return $this->service->getUsers();
    }
}
```

---

📁 Directory Structure
---------------------

[](#-directory-structure)

Example structure generated by the package:

```
app/
 ├── Repositories/
 │    └── UserRepository.php
 ├── Services/
 │    └── UserService.php

```

---

🧪 Testing
---------

[](#-testing)

Run your Laravel tests:

```
php artisan test
```

---

⚠️ Troubleshooting
------------------

[](#️-troubleshooting)

- Run `composer dump-autoload` if classes are not found
- Ensure correct namespace configuration
- Check Laravel version compatibility

---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome!

1. Fork the repository
2. Create a new branch
3. Make your changes
4. Submit a pull request

---

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the MIT license.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance91

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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 ~7 days

Recently: every ~13 days

Total

8

Last Release

41d ago

PHP version history (2 changes)v1.0.0PHP ^8.0

v1.0.2PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![mitul456](https://avatars.githubusercontent.com/u/100792680?v=4)](https://github.com/mitul456 "mitul456 (16 commits)")

---

Tags

phplaravelrepository patternservice layerclean architecture

### Embed Badge

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

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

###  Alternatives

[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M200](/packages/laravel-ai)[livewire/flux

The official UI component library for Livewire.

9527.8M128](/packages/livewire-flux)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[laravel/surveyor

Static analysis tool for Laravel applications.

86121.4k13](/packages/laravel-surveyor)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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