PHPackages                             lyhty/commands - 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. lyhty/commands

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

lyhty/commands
==============

Adds some very convenient commands to your Laravel project

v4.0.0(3w ago)27.5k↑17.3%MITPHPPHP ^8.2

Since Jul 16Pushed 3w agoCompare

[ Source](https://github.com/lyhty/commands)[ Packagist](https://packagist.org/packages/lyhty/commands)[ Docs](https://matti.suoraniemi.com/lyhty/commands)[ RSS](/packages/lyhty-commands/feed)WikiDiscussions main Synced yesterday

READMEChangelog (7)Dependencies (7)Versions (9)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/34b1a5f82c8020621968698f62e8625e17c3997b182f5e3a9d55e990f698c0b0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c796874792f636f6d6d616e64733f6c6162656c3d266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465267374796c653d666c61742d737175617265)](https://packagist.org/packages/lyhty/commands)[![PHP](https://camo.githubusercontent.com/c6b26613da96e82cb791d9f970822911883106a3a817f42ae44660b73bd04649/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c796874792f636f6d6d616e64733f7374796c653d666c61742d737175617265266c6162656c3d266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/lyhty/commands)[![Laravel](https://camo.githubusercontent.com/c6252c8f96c72ebd2d4ac653eab468feaf0ba76504270a3d372e11324dd8f6ef/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d266d6573736167653d2535453132253230253743253230253545313326636f6c6f723d726564267374796c653d666c61742d737175617265266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/lyhty/co%5Emands)[![Total Downloads](https://camo.githubusercontent.com/cbef37314c862507f13bb972f1e2b384d34b6b1260b019d14f789166f57e51c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c796874792f636f6d6d616e64733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lyhty/commands)[![License](https://camo.githubusercontent.com/78617565a056b9e59762e2f04b213d0d3e2db32baf5a14d9bd9da32c958fa3d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c796874792f636f6d6d616e64733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lyhty/commands)

This package provides some additional, convenient commands for you to use with your Laravel project.

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

[](#installation)

Install the package with Composer:

```
composer require lyhty/commands

```

Commands
--------

[](#commands)

Here's a brief documentation on the make commands the package provides to be used with Artisan.

### Commands for creating PHP OOP types

[](#commands-for-creating-php-oop-types)

```
artisan make:class --type[=TYPE]

```

> Valid values for option `type`: `final`, `abstract`.

```
artisan make:attribute --type[=TYPE] --target[=TARGET]

```

> Same valid values for option `type` as in `make:class`
>
> Valid values for option `target`: `class`, `function`, `method`, `property`, `class_constant`, `parameter`, `all`

```
artisan make:interface
artisan make:trait
artisan make:enum --backed[=BACKED]

```

### Commands for Model development

[](#commands-for-model-development)

#### Relationship trait

[](#relationship-trait)

```
artisan make:relationship --explicit --relation[=RELATION] --model[=MODEL]

```

Creates a relationship trait to be used with models. The command tries to guess both the relation and the model class from the `name` argument. Both can be overwritten by providing options for each. By adding the `explicit` option, parsing will not be used and options for both `model` and `relation` must be provided.

#### Scope class

[](#scope-class)

```
artisan make:scope --extend

```

Creates a scope class to be used with models. Defaults to the namespace the project's models exist in (e.g. App\\Models\\Scopes). When using `extend` option, the class will also include `extend` function, used to apply Builder macros to the model the scope is attached to as a global scope.

### Commands for creating classes for Spatie's QueryBuilder *(if part of the project)*

[](#commands-for-creating-classes-for-spaties-querybuilder-if-part-of-the-project)

```
artisan make:query-filter
artisan make:query-sort

```

### Other Commands

[](#other-commands)

#### Concern trait

[](#concern-trait)

```
artisan make:concern

```

Creates a concern trait. It's practically a trait that just follows the Laravel naming conventions. Defaults to the root namespace of the project (e.g. App\\Concerns).

#### Contract trait

[](#contract-trait)

```
artisan make:contract

```

Creates a contract interface. It's practically an interface that just follows the Laravel naming conventions. Defaults to the root namespace of the project (e.g. App\\Contracts).

#### Generator Command class

[](#generator-command-class)

```
artisan make:command-gen --explicit --type[=TYPE] --stub[=STUB]

```

Creates a generator command and a stub. Command parses the type name from the given name argument. E.g. `artisan make:command-gen ConcernMakeCommand` would set the command name to be `make:concern` and the stub file to be named `concern.stub`. This behavior can be overwritten with using the `explicit` option and/or providing `type` and `stub` options respectively.

License
-------

[](#license)

Lyhty Commands is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

53

—

FairBetter than 96% of packages

Maintenance96

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity66

Established project with proven stability

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

Recently: every ~297 days

Total

8

Last Release

21d ago

Major Versions

v1.0.0 → v2.0.02022-08-16

v2.3.0 → v3.0.02025-04-27

v3.0.1 → v4.0.02026-06-12

PHP version history (4 changes)v1.0.0PHP &gt;=7.1.3

v2.0.0PHP ^7.4 | ^8.0

v2.3.0PHP ^7.4 | ^8.0 | ^8.2

v3.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/2cd5d6f2caaea83278fd1552c5bdc1b30b4164890ba0801a718dc20efa93738c?d=identicon)[TruecapeDev](/maintainers/TruecapeDev)

---

Top Contributors

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

---

Tags

commandsconsolelaravellaravelcommands

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lyhty-commands/health.svg)

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

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.4k](/packages/larastan-larastan)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M146](/packages/laravel-cashier)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)

PHPackages © 2026

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