Search by

premsoni / laravel-artisan-shortcuts

prem-soni

Shortcuts for Laravel Artisan commands

Package info

github.com/prem-soni/prem-soni-laravel-artisan-shortcuts

pkg:composer/premsoni/laravel-artisan-shortcuts

Statistics

Installs: 8

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2025-05-06 08:04 UTC

This package is auto-updated.

Last update: 2026-10-28 03:05:38 UTC


README

A simple package to create shortcuts for common Artisan commands in Laravel.

Installation

You can install the package via Composer. Run the following command in the root directory of your Laravel project:

composer require premsoni/laravel-artisan-shortcuts:^1.0

Installing from Git repository (Alternative)

If the package is not published on Packagist, you can install it by adding the Git repository to your project's composer.json:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/prem-soni/prem-soni-laravel-artisan-shortcuts"
        }
    ]
}

Then run:

composer require premsoni/laravel-artisan-shortcuts:dev-main

Usage

Run any shortcut command by passing the alias key (cmd) and optionally a name or class argument (name):

php artisan ps {cmd} {name?}

Available Shortcuts

Here is the complete list of available shortcuts:

1. Make Commands

Shortcut Action Description Example Usage
m make:model {Name} -mcr Create a Model, Migration, Controller, and Resource php artisan ps m Post
c make:controller {Name}Controller Create a Controller php artisan ps c Post
f make:factory {Name}Factory Create a Factory php artisan ps f Post
sdr make:seeder {Name}Seeder Create a Seeder class php artisan ps sdr Post
p make:policy {Name}Policy Create a Policy php artisan ps p Post
migc make:migration create_{Name}_table Create a new table migration php artisan ps migc posts
migf migrate --force Run migration with force php artisan ps migf

2. Migration Commands

Shortcut Action Description Example Usage
mi migrate Run migrations php artisan ps mi
mir migrate:reset Reset all migrations php artisan ps mir
mib migrate:rollback Rollback the last migration php artisan ps mib
mip migrate:refresh Refresh the database migrations php artisan ps mip
mis migrate:status Show migrations status php artisan ps mis
mif migrate --path=database/migrations/{Name}.php Run a specific migration file php artisan ps mif 2026_01_01_000000_create_posts_table

3. Database Seeding Commands

Shortcut Action Description Example Usage
sd db:seed Seed the database php artisan ps sd
sdf db:seed --force Seed the database with force php artisan ps sdf
sdc db:seed --class={Name}Seeder Run a specific seeder class php artisan ps sdc Post

4. Route Commands

Shortcut Action Description Example Usage
rl route:list List all registered routes php artisan ps rl
rc route:cache Cache all routes php artisan ps rc
rcl route:clear Clear route cache php artisan ps rcl

5. Cache / Config / View Commands

Shortcut Action Description Example Usage
cc cache:clear Clear the application cache php artisan ps cc
cfgc config:cache Create a configuration cache file php artisan ps cfgc
cfgcl config:clear Remove the configuration cache file php artisan ps cfgcl
vc view:clear Clear all compiled view files php artisan ps vc
opt optimize Cache framework bootstrap files php artisan ps opt

6. Development Server & Shell Commands

Shortcut Action Description Example Usage
s serve Start the Laravel development server php artisan ps s
tk tinker Open interactive Tinker shell php artisan ps tk

Contributing

If you would like to contribute to this package, feel free to fork the repository, make changes, and submit a pull request.

License

This package is open-sourced software licensed under the MIT license.