muath-ic/artisan-command-alias

Define aliases for Laravel Artisan commands

dev-master 2020-01-01 10:18 UTC

This package is auto-updated.

Last update: 2025-05-29 01:44:25 UTC


README

Latest Version on Packagist Build Status Total Downloads GitHub license

This package allows you to create some aliases for Artisan purpose. It's like bash, but for Artisan.

Installation

You can install the package via composer:

composer require muath-ic/artisan-command-alias

Usage

First, you need to publish the configuration file which storing all your availabled aliases with

php artisan vendor:publish --provider="muath-ic\CommandAlias\ArtisanCommandAliasServiceProvider"

Now, edit config/artisan-command-alias.php and creates yours like

<?php

/*
 * Configuration file for CommandAlias package
 */
return [
	/*
	 * Register all your alias in the next array. You can use string association
	 * if there's no argument.
	 *
	 * https://laravel.com/docs/5.6/artisan#programmatically-executing-commands
	 */
	'commands' => [
		'i' => 'inspire',
		'lsr' => ['route:list', ['--reverse' => true]],
	]
];

You may create a bash alias for Artisan like alias a="php artisan" and execute command like a i or a lsr as git (alias g="git" ; g lga).

License

The MIT License (MIT). Please see License File for more information.