PHPackages                             goodmanluphondo/laravel-service-repository-pattern - 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. [Framework](/categories/framework)
4. /
5. goodmanluphondo/laravel-service-repository-pattern

ActiveLibrary[Framework](/categories/framework)

goodmanluphondo/laravel-service-repository-pattern
==================================================

Service-Repository pattern for your Laravel applications

v1.0.0(9mo ago)05MITPHPPHP ^8.0

Since Jul 20Pushed 9mo agoCompare

[ Source](https://github.com/goodmanluphondo/laravel-service-provider-patterm)[ Packagist](https://packagist.org/packages/goodmanluphondo/laravel-service-repository-pattern)[ RSS](/packages/goodmanluphondo-laravel-service-repository-pattern/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Laravel Service-Repository Pattern
==================================

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

[![Latest Stable Version](https://camo.githubusercontent.com/d69ea043e4f359d8220cffe2d051e486931c4bcd8842d276892bbd64408bf225/68747470733a2f2f706f7365722e707567782e6f72672f676f6f646d616e6c7570686f6e646f2f6c61726176656c2d736572766963652d7265706f7369746f72792d7061747465726e2f762f737461626c65)](https://packagist.org/packages/goodmanluphondo/laravel-service-repository-pattern)[![Total Downloads](https://camo.githubusercontent.com/beef5c037c566e4ee8146ac5f2aba752ebe06c7e566ff7ede2ca6ef06caafda4/68747470733a2f2f706f7365722e707567782e6f72672f676f6f646d616e6c7570686f6e646f2f6c61726176656c2d736572766963652d7265706f7369746f72792d7061747465726e2f646f776e6c6f616473)](https://packagist.org/packages/goodmanluphondo/laravel-service-repository-pattern)[![License](https://camo.githubusercontent.com/b2a8cbea3ddc6af79a7faaa2e0202e92ec24423cf380cd882118a59eadf4662b/68747470733a2f2f706f7365722e707567782e6f72672f676f6f646d616e6c7570686f6e646f2f6c61726176656c2d736572766963652d7265706f7369746f72792d7061747465726e2f6c6963656e7365)](https://packagist.org/packages/goodmanluphondo/laravel-service-repository-pattern)

A Laravel package that helps you implement the Service-Repository pattern in your Laravel applications. This package provides base classes and Artisan commands to quickly scaffold repositories, interfaces, and services following clean architecture principles.

> **Note:** This package enforces separation of concerns between data access and business logic. Use it to maintain clean, testable, and maintainable code architecture.

This package includes the following features:

- **Scaffolding Commands**: Generate services, repositories, and interfaces with a single command
- **Base Classes**: Pre-built base repository and service classes with common CRUD operations
- **Clean Architecture**: Enforces separation of concerns between data access and business logic
- **Namespace Support**: Supports sub-namespaces for better organization
- **Automatic Binding**: Automatically registers repository interfaces with their implementations

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

[](#installation)

Require this package with composer:

```
composer require goodmanluphondo/laravel-service-repository-pattern
```

Laravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

### Laravel without auto-discovery:

[](#laravel-without-auto-discovery)

If you don't use auto-discovery, add the ServiceProvider to the providers list. For Laravel 11 or newer, add the ServiceProvider in `bootstrap/providers.php`. For Laravel 10 or older, add the ServiceProvider in `config/app.php`.

```
// config/app.php (Laravel 10 and older)
'providers' => [
    // Other providers...
    GoodmanLuphondo\LaravelServiceRepositoryPattern\Providers\ServiceRepositoryPatternServiceProvider::class,
],

// bootstrap/providers.php (Laravel 11+)
