PHPackages                             esfredderick/useful-artisan-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. esfredderick/useful-artisan-commands

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

esfredderick/useful-artisan-commands
====================================

A collection of useful Laravel Artisan commands for generating actions, DTOs, and more.

v1.4.0(1mo ago)077↓90%2MITPHPPHP ^8.2

Since Mar 30Pushed 1mo agoCompare

[ Source](https://github.com/esfredderickmx/useful-artisan-commands)[ Packagist](https://packagist.org/packages/esfredderick/useful-artisan-commands)[ RSS](/packages/esfredderick-useful-artisan-commands/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (5)Dependencies (8)Versions (6)Used By (2)

Useful Artisan Commands
=======================

[](#useful-artisan-commands)

A collection of handy Laravel Artisan commands for generating actions, DTOs, and configuring databases.

Requires **PHP 8.2+** and **Laravel 12 or 13**.

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

[](#installation)

```
composer require esfredderick/useful-artisan-commands --dev
```

Auto-discovery registers the commands automatically.

Automatic PostgreSQL Verification
---------------------------------

[](#automatic-postgresql-verification)

When the package is installed, it automatically listens for `migrate*` Artisan commands. For PostgreSQL connections, it verifies that:

- the configured database exists, creating it through a maintenance `postgres` connection when possible
- the configured migrations schema exists when `database.migrations.table` uses `schema.table` notation

This requires no application service provider setup while Laravel package auto-discovery is enabled. The verification also runs eagerly during unit tests so migration-backed test databases can be prepared before the test suite touches the connection.

If package discovery is disabled for this package, manually register `EsFredDerick\UsefulArtisanCommands\UsefulArtisanCommandsServiceProvider` in `bootstrap/providers.php`.

Commands
--------

[](#commands)

### `make:action`

[](#makeaction)

Generates an action class in `app/Actions/`. The `Action` suffix is auto-appended.

```
php artisan make:action CreateUser
# -> app/Actions/CreateUserAction.php

php artisan make:action Billing/ChargeInvoice
# -> app/Actions/Billing/ChargeInvoiceAction.php
```

OptionDescription`-d`, `--data`Also generate a matching DTO class`-f`, `--force`Overwrite if file already exists### `make:data`

[](#makedata)

Generates a `final readonly` DTO class in `app/Data/`. The `Data` suffix is auto-appended.

```
php artisan make:data CreateUser
# -> app/Data/CreateUserData.php
```

OptionDescription`-f`, `--force`Overwrite if file already exists### `app:config-db`

[](#appconfig-db)

Interactive prompt to configure PostgreSQL connection details in your `.env` file.

```
php artisan app:config-db
```

Prompts for host, port, database name, username, and password. Before saving, it shows a review table and lets you correct selected fields. Use `schemas:config-defaults` to configure schema-qualified Laravel framework tables such as the migrations table.

### `schemas:config-defaults`

[](#schemasconfig-defaults)

Interactive prompt to configure PostgreSQL schema-qualified Laravel framework tables.

```
php artisan schemas:config-defaults
```

It can write values directly to config files or to a selected `.env*` file, ignoring `.env.example`. It also syncs starter migrations for schemas, users, password reset tokens, sessions, cache, cache locks, jobs, job batches, failed jobs, and optional starter-kit two-factor/team tables.

Prefer running it when starting a new project, before migration history matters.

OptionDescription`-c`, `--clean-env`After choosing config-file writes, remove managed schema table keys from local `.env*` filesStarter-kit models stay in `app/Models`; only their table declarations are synced. The declaration style follows the host Laravel version:

LaravelModel table declaration13+`#[Table('schema.table')]` attribute12`protected $table = 'schema.table';` propertyCustomizing Stubs
-----------------

[](#customizing-stubs)

Publish the stubs to customize the generated file templates:

```
php artisan vendor:publish --tag=useful-artisan-commands-stubs
```

This copies `action.stub` and `data.stub` to your project's `stubs/` directory. The commands will use your local stubs over the package defaults.

License
-------

[](#license)

MIT

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance90

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

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

Total

5

Last Release

52d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79d682351c4c4ff99c080bc3adf1828479a57fdaf5b8cc159734cd858df8619b?d=identicon)[esfredderickmx](/maintainers/esfredderickmx)

---

Top Contributors

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

---

Tags

laravelartisandtoactionscommands

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/esfredderick-useful-artisan-commands/health.svg)

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

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k2.1M163](/packages/laravel-ai)[larastan/larastan

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

6.4k51.0M7.7k](/packages/larastan-larastan)[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M154](/packages/spatie-laravel-health)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9772.3M122](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

761621.7k17](/packages/wendelladriel-laravel-validated-dto)

PHPackages © 2026

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