PHPackages                             hnabeel64/repopackage - 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. hnabeel64/repopackage

ActiveLibrary[Framework](/categories/framework)

hnabeel64/repopackage
=====================

Repository pattern made easy in laravel By hnabeel64

02PHP

Since Oct 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/hnabeel64/repopackage)[ Packagist](https://packagist.org/packages/hnabeel64/repopackage)[ RSS](/packages/hnabeel64-repopackage/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

repopackage
===========

[](#repopackage)

Make Repository service class, Interfaces and predefined methods and model with just one command. Simple to Medium CRUD generator ease of development for repository pattern followers.
=======================================================================================================================================================================================

[](#make-repository-service-class-interfaces-and-predefined-methods-and-model-with-just-one-command-simple-to-medium-crud-generator-ease-of-development-for-repository-pattern-followers)

The repopackage is the idea of repository design pattern implementation for beginner to intermediate developer. Time savour for the developer just install the package and publish assets. Don't need to add Model manually just run the command and repopackage will take care the other things. ;)

1. Install package by this command `composer require hnabeel64/repopackage`
2. Then publish the vendor `php artisan vendor:publish --tag=repository`
3. Now When a new table exist and you want to make a crud for it just write on console `php artisan repository:make {TableName}` if you want a model too it asks for model confirmation you just have to define `protected $fillable = [];` into model and just try catch the methods on controller.

Usage
-----

[](#usage)

Repository pattern is easy to use as:

when you publish the vendor and make a new repository through command, this Base Interface come with pre defined methods such as:

```
public function findAll(): Collection;

public function findById($id): ?Model;

public function storeRecord(array $array): ?Model;

public function updateRecord($id, array $array): bool;

public function deleteRecord($id): bool;

public function findLatest(): Model;

public function findByUpdated(): Model;
```

These are predefined methods in repository and Interface have and both are bind on service container through service provider dynamically.

Child Interface contain following extra methods

```
    public function findAll(): Collection;

    public function findById($id): ?Model;

    public function storeRecord(array $array): ?Model;

    public function updateRecord($id, array $array): bool;

    public function deleteRecord($id): bool;

    public function findLatest(): Model;

    public function findByUpdated(): Model;

    public function findBy($field, $value): ?Model;

    public function search($field, $value): ?Model;
```

⚠️ **NOTE:** you have to implement these methods in controller with try catch blocks. Import the repository class through dependency-injection Example

```
use App\Repository\SlugRepository;

private $slug;
    public function __construct(SlugRepository $slug)
    {
        $this->slug = $slug;
    }
public function search(Request $request)
    {
        try
        {
            $name = $request->name;
            $field = 'name';
            $result = $this->slug->search($field, $name);
            if(!empty($result))
            {
                return $result;
            }
            return 'no record found';
        }
        catch (\Throwable $th) {
            return $th;
        }
    }
```

If you find any vulnerability or issue you can contact me on my email or open an issue here. any contributor are welcome :)

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/hnabeel64-repopackage/health.svg)

```
[![Health](https://phpackages.com/badges/hnabeel64-repopackage/health.svg)](https://phpackages.com/packages/hnabeel64-repopackage)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M190](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M255](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M591](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M120](/packages/cakephp-chronos)

PHPackages © 2026

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