{"id":18920562,"url":"https://github.com/caneco/artisan-aliases","last_synced_at":"2025-06-21T13:39:21.520Z","repository":{"id":62499383,"uuid":"164950857","full_name":"caneco/artisan-aliases","owner":"caneco","description":"Save keystrokes and run Artisan commands your way","archived":false,"fork":false,"pushed_at":"2019-01-30T11:59:53.000Z","size":84,"stargazers_count":22,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T13:48:22.585Z","etag":null,"topics":["aliases","artisan","cli","command","laravel"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caneco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-09T22:52:02.000Z","updated_at":"2025-02-16T04:27:18.000Z","dependencies_parsed_at":"2022-11-02T12:00:57.030Z","dependency_job_id":null,"html_url":"https://github.com/caneco/artisan-aliases","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/caneco/artisan-aliases","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caneco%2Fartisan-aliases","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caneco%2Fartisan-aliases/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caneco%2Fartisan-aliases/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caneco%2Fartisan-aliases/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caneco","download_url":"https://codeload.github.com/caneco/artisan-aliases/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caneco%2Fartisan-aliases/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261130965,"owners_count":23114053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aliases","artisan","cli","command","laravel"],"created_at":"2024-11-08T10:43:35.678Z","updated_at":"2025-06-21T13:39:16.493Z","avatar_url":"https://github.com/caneco.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/caneco/artisan-aliases/master/art/logo.png\" width=\"400\"/\u003e\n\u003c/p\u003e\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/caneco/artisan-aliases/master/art/preview.png\" width=\"560\"/\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://packagist.org/packages/caneco/artisan-aliases\"\u003e\u003cimg src=\"https://poser.pugx.org/caneco/artisan-aliases/d/total.svg\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/caneco/artisan-aliases\"\u003e\u003cimg src=\"https://poser.pugx.org/caneco/artisan-aliases/v/stable.svg\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/caneco/artisan-aliases\"\u003e\u003cimg src=\"https://poser.pugx.org/caneco/artisan-aliases/license.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n# Laravel Artisan Aliases\n\nIf 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..\n\n\n\n## Installation\n\nYou can install the package via composer:\n\n```\n\u003e_ composer require caneco/artisan-aliases\n```\n\n#### Registering the service provider\nIn Laravel 5.5 the service provider will automatically get registered. But if needed just add the service provider in `config/app.php` file:\n\n```\n'providers' =\u003e [\n    // ...\n    Caneco\\ArtisanAliases\\ArtisanAliasesServiceProvider::class,\n];\n```\n\n#### Publishing the package assets\nTo publish the configuration file and `.laravel_alias`, execute the following command and pick this Service Provider:\n\n```\n\u003e_ php artisan vendor:publish\n\n Which provider or tag's files would you like to publish?:\n  [0 ] Publish files from all providers and tags listed below\n  [1 ] Provider: Caneco\\ArtisanAliasesExample:\n  [… ] ...\n```\n\nOr do it in a single command:\n\n```\n\u003e_ php artisan vendor:publish --provider=\"Caneco\\ArtisanAliases\\ArtisanAliasesServiceProvider\"\n```\n\nWhen published, this is the contents of the config file:\n\n```PHP\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Artisan Alias Master Switch\n    |--------------------------------------------------------------------------\n    | This option may be used to enable/disable all Artisan alias\n    | defined in your local or global `.laravel_alias` file\n    */\n    'enabled' =\u003e env('ARTISAN_ALIAS_ENABLED', true),\n\n    /*\n    |--------------------------------------------------------------------------\n    | Default Alias File\n    |--------------------------------------------------------------------------\n    | This option allows you to have three ways of load the list of alias. The\n    | `global` option will only load the alias defined in your home directory,\n    | while the `local` option, will limit the alias from the list in your\n    | application. Finally, The `both` option, or anything else, will\n    | load the alias from both locations.\n    |\n    | Supported: \"global\", \"local\", \"both\",\n    */\n    'use_only' =\u003e 'both',\n\n];\n```\n\n\n\n\n## Usage\n\nAfter 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:\n\n```\nlaravel=\"inspire\"\n# cc=\"clear-compiled\"\n```\n\n#### Listing existing alias\nTo list the current alias available you can run the following command:\n\n```\n\u003e_ php artisan alias --list\nLaravel `Artisan Aliases` 1.1.0\n\nUsage:\n alias [-g|--global] [--] [\u003cas\u003e]\n\nAvailable alias:\n laravel inspire\n cc      clear-compiled\n```\n\nAlso, the available alias in appear on your artisan command list:\n\n```\n$ php artisan list\n...\nAvailable commands:\n  alias                Create an alias of another command\n  cc                   * Alias for the `clear-compiled` command\n  clear-compiled       Remove the compiled class file\n  down                 Put the application into maintenance mode\n  ...\n  inspire              Display an inspiring quote\n  laravel              * Alias for the `inspire` command\n  list                 Lists commands\n  ...\n```\n\n\n#### Adding new alias\nAdd your alias directly in the file `.laravel_alias`, or just use the artisan command:\n\n```\n\u003e_ php artisan alias laravel \"inspire\"\n```\n\nAnd, if you pass the `--global` option the alias will be registered instead in the `.laravel_alias` of your home directory.\n\n```\n\u003e_ php artisan alias cc=\"clear-compiled\" --global\n```\n\nIf 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.\n\n#### Comments\nAnything after the character `#` it's considered a comment and will be not considered for execution.\n\n```\n# https://twitter.com/davidhemphill/status/1083466919964041217\nmigrate:make=\"make:migration\" # DOPE\n```\n\n#### Quote surrounding\nSurrounding the command with quotes are not mandatory, but if the command to be aliased has some spaces you must use them.\n\n#### Multiple commands\nAn alias can have multiple commands associated by using the operators `\u0026\u0026` or `||`. And, just like bash, when using `\u0026\u0026` the sequence of the commands will terminate if one of them returns a value bigger than zero. While the `||` will continue no matter what.\n\n```\n# EXAMPLE\n\ntables-up=notifications:table \u0026\u0026 queue:table \u0026\u0026 queue:failed-table \u0026\u0026 ...\n```\n\n#### Shell commands\nIf you prefix your alias with an exclamation point, will be treated as a shell command.\n\n#### Alias*ception…*\nYes, you can also create alias of alias...\n\n#### Artisan groups\nIf you set your alias with a namespace like `boot:tables` or `boot:cache`, Artisan list will group your alias toghether.\n\n```\n# EXAMPLE\n\nboot\n boot:cache    * Alias for the `config:cache || route:cache || view:cache command`\n boot:tables   * Alias for the `cache:table || notifications:table || queue:failed-table || queue:table || session:table command`\n```\n\n\n\n\n## Gotchas ⚠️\n\n- 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.\n- Adding an alias with the same name as other it will result with an exception.\n- Having two alias manually defined in the `.laravel_aliases` the last alias command will prevail.\n- An alias with the same name as an Artisan command, the Artisan prevail.\n\n\n\n\n## Supported versions\n\nLook at the table below to find out what versions of Laravel are supported on what version of this package:\n\nLaravel Framework | Artisan Alias\n:--- | :---\n`5.7.*` | `^1.0`\n\n\n\n\n## Road map\n\nArtisan Alias is stable but there is still some things that I would like to add in the package.\n\nHere's the plan for what's coming:\n\n- [ ] Remove an existing alias using the option `--d|delete`\n- [ ] Firing a `@handle` method if alias has a `::class` reference\n- [ ] Alert the user try to add an alias with `sudo` in the command **(usefull?)**\n- [ ] Add comments\n- [x] Allow to replace an existing alias using the option `--force`\n- [x] Add tests\n\n\n\n\n## Contributing\n\nAll 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.\n\n\n\n\n## License\n\nThe MIT License (MIT). Please see [License File](/caneco/artisan-alias/blob/master/LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaneco%2Fartisan-aliases","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaneco%2Fartisan-aliases","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaneco%2Fartisan-aliases/lists"}