PHPackages                             caneco/artisan-aliases - 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. caneco/artisan-aliases

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

caneco/artisan-aliases
======================

Save keystrokes and run Artisan commands your way

1.1.0(7y ago)22721[1 issues](https://github.com/caneco/artisan-aliases/issues)MITPHPPHP ^7.1

Since Jan 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/caneco/artisan-aliases)[ Packagist](https://packagist.org/packages/caneco/artisan-aliases)[ RSS](/packages/caneco-artisan-aliases/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

[![](https://raw.githubusercontent.com/caneco/artisan-aliases/master/art/logo.png)](https://raw.githubusercontent.com/caneco/artisan-aliases/master/art/logo.png)

[![](https://raw.githubusercontent.com/caneco/artisan-aliases/master/art/preview.png)](https://raw.githubusercontent.com/caneco/artisan-aliases/master/art/preview.png)

[![Total Downloads](https://camo.githubusercontent.com/c5a8f986630b181649cc0f8ddd673e2c98d78af1c3289c4b627ca02e3a993c0e/68747470733a2f2f706f7365722e707567782e6f72672f63616e65636f2f6172746973616e2d616c69617365732f642f746f74616c2e737667)](https://packagist.org/packages/caneco/artisan-aliases)[![Latest Stable Version](https://camo.githubusercontent.com/b6fb86f6f9d461fcc2ab5f9be8a3b416c25c57f0dfb76e76053d1affa46884f5/68747470733a2f2f706f7365722e707567782e6f72672f63616e65636f2f6172746973616e2d616c69617365732f762f737461626c652e737667)](https://packagist.org/packages/caneco/artisan-aliases)[![License](https://camo.githubusercontent.com/172138526c12e14d93868cd0a34c25cb5dadbd445ea166d648fbb6f162e49f36/68747470733a2f2f706f7365722e707567782e6f72672f63616e65636f2f6172746973616e2d616c69617365732f6c6963656e73652e737667)](https://packagist.org/packages/caneco/artisan-aliases)

---

Laravel Artisan Aliases
=======================

[](#laravel-artisan-aliases)

If you live in the command it's always good to save some keystrokes, specially for commands that you keep typing. This package will help you create alias for you artisan commands, and more..

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

[](#installation)

You can install the package via composer:

```
>_ composer require caneco/artisan-aliases

```

#### Registering the service provider

[](#registering-the-service-provider)

In Laravel 5.5 the service provider will automatically get registered. But if needed just add the service provider in `config/app.php` file:

```
'providers' => [
    // ...
    Caneco\ArtisanAliases\ArtisanAliasesServiceProvider::class,
];

```

#### Publishing the package assets

[](#publishing-the-package-assets)

To publish the configuration file and `.laravel_alias`, execute the following command and pick this Service Provider:

```
>_ php artisan vendor:publish

 Which provider or tag's files would you like to publish?:
  [0 ] Publish files from all providers and tags listed below
  [1 ] Provider: Caneco\ArtisanAliasesExample:
  [… ] ...

```

Or do it in a single command:

```
>_ php artisan vendor:publish --provider="Caneco\ArtisanAliases\ArtisanAliasesServiceProvider"

```

When published, this is the contents of the config file:

```
return [

    /*
    |--------------------------------------------------------------------------
    | Artisan Alias Master Switch
    |--------------------------------------------------------------------------
    | This option may be used to enable/disable all Artisan alias
    | defined in your local or global `.laravel_alias` file
    */
    'enabled' => env('ARTISAN_ALIAS_ENABLED', true),

    /*
    |--------------------------------------------------------------------------
    | Default Alias File
    |--------------------------------------------------------------------------
    | This option allows you to have three ways of load the list of alias. The
    | `global` option will only load the alias defined in your home directory,
    | while the `local` option, will limit the alias from the list in your
    | application. Finally, The `both` option, or anything else, will
    | load the alias from both locations.
    |
    | Supported: "global", "local", "both",
    */
    'use_only' => 'both',

];
```

Usage
-----

[](#usage)

After publishing the initial files, your alias will be stored folder locally in the application directory; or globally in your home directory. And like any other bash alias file the contents will have following format:

```
laravel="inspire"
# cc="clear-compiled"

```

#### Listing existing alias

[](#listing-existing-alias)

To list the current alias available you can run the following command:

```
>_ php artisan alias --list
Laravel `Artisan Aliases` 1.1.0

Usage:
 alias [-g|--global] [--] []

Available alias:
 laravel inspire
 cc      clear-compiled

```

Also, the available alias in appear on your artisan command list:

```
$ php artisan list
...
Available commands:
  alias                Create an alias of another command
  cc                   * Alias for the `clear-compiled` command
  clear-compiled       Remove the compiled class file
  down                 Put the application into maintenance mode
  ...
  inspire              Display an inspiring quote
  laravel              * Alias for the `inspire` command
  list                 Lists commands
  ...

```

#### Adding new alias

[](#adding-new-alias)

Add your alias directly in the file `.laravel_alias`, or just use the artisan command:

```
>_ php artisan alias laravel "inspire"

```

And, if you pass the `--global` option the alias will be registered instead in the `.laravel_alias` of your home directory.

```
>_ php artisan alias cc="clear-compiled" --global

```

If you dont pass the required arguments the `--list` option will be triggered, and you will be presented with the command info; usage; and list of alias available.

#### Comments

[](#comments)

Anything after the character `#` it's considered a comment and will be not considered for execution.

```
# https://twitter.com/davidhemphill/status/1083466919964041217
migrate:make="make:migration" # DOPE

```

#### Quote surrounding

[](#quote-surrounding)

Surrounding the command with quotes are not mandatory, but if the command to be aliased has some spaces you must use them.

#### Multiple commands

[](#multiple-commands)

An alias can have multiple commands associated by using the operators `&&` or `||`. And, just like bash, when using `&&` the sequence of the commands will terminate if one of them returns a value bigger than zero. While the `||` will continue no matter what.

```
# EXAMPLE

tables-up=notifications:table && queue:table && queue:failed-table && ...

```

#### Shell commands

[](#shell-commands)

If you prefix your alias with an exclamation point, will be treated as a shell command.

#### Alias*ception…*

[](#aliasception)

Yes, you can also create alias of alias...

#### Artisan groups

[](#artisan-groups)

If you set your alias with a namespace like `boot:tables` or `boot:cache`, Artisan list will group your alias toghether.

```
# EXAMPLE

boot
 boot:cache    * Alias for the `config:cache || route:cache || view:cache command`
 boot:tables   * Alias for the `cache:table || notifications:table || queue:failed-table || queue:table || session:table command`

```

Gotchas ⚠️
----------

[](#gotchas-️)

- Currently, to modify or delete any alias you need to open the `.laravel_aliases` and do it manually but it's planned to have a way of doing from the terminal.
- Adding an alias with the same name as other it will result with an exception.
- Having two alias manually defined in the `.laravel_aliases` the last alias command will prevail.
- An alias with the same name as an Artisan command, the Artisan prevail.

Supported versions
------------------

[](#supported-versions)

Look at the table below to find out what versions of Laravel are supported on what version of this package:

Laravel FrameworkArtisan Alias`5.7.*``^1.0`Road map
--------

[](#road-map)

Artisan Alias is stable but there is still some things that I would like to add in the package.

Here's the plan for what's coming:

- Remove an existing alias using the option `--d|delete`
- Firing a `@handle` method if alias has a `::class` reference
- Alert the user try to add an alias with `sudo` in the command **(usefull?)**
- Add comments
- Allow to replace an existing alias using the option `--force`
- Add tests

Contributing
------------

[](#contributing)

All contributions (pull requests, issues and feature requests) are welcome. Make sure to read through the [Contributing file](/caneco/artisan-alias/blob/master/CONTRIBUTING.md) first, though. See the [contributors page](/caneco/artisan-aliases/graphs/contributors) for all contributors.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](/caneco/artisan-alias/blob/master/LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

Total

2

Last Release

2708d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/502041?v=4)[Caneco](/maintainers/Caneco)[@caneco](https://github.com/caneco)

---

Top Contributors

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

---

Tags

aliasesartisanclicommandlaravelclilaravelartisanaliasaliases

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/caneco-artisan-aliases/health.svg)

```
[![Health](https://phpackages.com/badges/caneco-artisan-aliases/health.svg)](https://phpackages.com/packages/caneco-artisan-aliases)
```

###  Alternatives

[nunomaduro/laravel-console-task

Laravel Console Task is a output method for your Laravel/Laravel Zero commands.

2592.3M13](/packages/nunomaduro-laravel-console-task)[timwassenburg/laravel-service-generator

Generate Laravel services

106255.4k2](/packages/timwassenburg-laravel-service-generator)[nunomaduro/laravel-console-dusk

Laravel Console Dusk allows the usage of Laravel Dusk in Laravel/Laravel Zero artisan commands.

16357.3k8](/packages/nunomaduro-laravel-console-dusk)[rahul900day/laravel-console-spinner

Laravel Console Spinner is a spinner output for Laravel command line.

76128.8k1](/packages/rahul900day-laravel-console-spinner)[timwassenburg/laravel-repository-generator

Generate Laravel repositories

2118.3k1](/packages/timwassenburg-laravel-repository-generator)[socialengine/sniffer-rules

A Lumen 5 and Laravel 5 SquizLabs Code Sniffer 2.0 artisan command. Detect violations of a defined coding standard. It helps your code remains clean and consistent.

1248.3k1](/packages/socialengine-sniffer-rules)

PHPackages © 2026

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