PHPackages                             hora/laravel-common-command - 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. [CLI &amp; Console](/categories/cli)
4. /
5. hora/laravel-common-command

AbandonedArchivedLibrary[CLI &amp; Console](/categories/cli)

hora/laravel-common-command
===========================

Common commands for Laravel

511PHP

Since Aug 26Pushed 5y ago1 watchersCompare

[ Source](https://github.com/bocanhcam/laravel-common-command)[ Packagist](https://packagist.org/packages/hora/laravel-common-command)[ RSS](/packages/hora-laravel-common-command/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Common Command
======================

[](#laravel-common-command)

A Laravel Package help you to generate some common command like Repository...

Install
-------

[](#install)

```
composer require hora/laravel-common-command

```

```
php artisan vendor:publish --provider="Hora\LaravelCommonCommand\LaravelCommonCommandServiceProvider"

```

Usage
-----

[](#usage)

Try command like this to generate Repository and Interface

```
php artisan make:repository Product

```

The generate files look like this :

```
namespace App\Repositories\Eloquents;

use App\Interfaces\ProductRepositoryInterface;
use App\Models\Product;

class ProductRepository implements ProductRepositoryInterface
{

    protected $product;

    /**
     * Product constructor.
     * @param Product $product
     */
    public function __construct(Product $product)
    {
        $this->product = $product;
    }

}
```

```
namespace App\Interfaces;

interface ProductRepositoryInterface
{

}
```

Config
------

[](#config)

By default it will generate Repository file in `Repositories` directory and Interface in `Interfaces` directory.

You can change it in file `config/laravel-common-command`

Options
-------

[](#options)

If you want to create something like `EloquentRepository` you can add prefix option to the command

Something like this

```
php artisan make:repository Product --prefix=Eloquent

```

You can also create Repository with template

```
php artisan make:repository Product --template

```

```
namespace App\Repositories;

use App\Interfaces\ProductRepositoryInterface;
use App\Models\Product;

class ProductRepository implements ProductRepositoryInterface
{

    protected $product;

    /**
     * Product constructor.
     * @param Product $product
     */
    public function __construct(Product $product)
    {
        $this->product = $product;
    }

    /**
     * @param $id
     * @return mixed
     */
    public function find($id)
    {
        return $this->product->find($id);
    }

    /**
     * @param $id
     * @return mixed
     */
    public function findOrFail($id)
    {
        return $this->product->findOrFail($id);
    }

    /**
     * @param array $data
     * @return mixed
     */
    public function create(array $data)
    {
        return $this->product->create($data);
    }

    /**
     * @param array $data
     * @param $id
     * @return mixed
     */
    public function update(array $data, $id)
    {
        $product = $this->findOrFail($id);
        return $product->update($data);
    }

    /**
     * @param $id
     * @return mixed
     */
    public function delete($id)
    {
        $product = $this->findOrFail($id);
        return $product->delete();
    }

}
```

```
interface ProductRepositoryInterface
{
    /**
     * @param $id
     * @return mixed
     */
    public function find($id);

    /**
     * @param $id
     * @return mixed
     */
    public function findOrFail($id);

    /**
     * @param array $data
     * @return mixed
     */
    public function create(array $data);

    /**
     * @param array $data
     * @param $id
     * @return mixed
     */
    public function update(array $data, $id);

    /**
     * @param $id
     * @return mixed
     */
    public function delete($id);
}
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity32

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/91a2ebe11c6e312f02d72b41fe97ac3c051c1988b7bba6d83f9404df565df5db?d=identicon)[bocanhcam](/maintainers/bocanhcam)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/hora-laravel-common-command/health.svg)

```
[![Health](https://phpackages.com/badges/hora-laravel-common-command/health.svg)](https://phpackages.com/packages/hora-laravel-common-command)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

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