Skip to content

Instantly share code, notes, and snippets.

@abhishekkhaware
Last active May 4, 2023 16:02
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save abhishekkhaware/7152721 to your computer and use it in GitHub Desktop.
Save abhishekkhaware/7152721 to your computer and use it in GitHub Desktop.
Create An Alias For Laravel and Codecept in Windows PowerShell.
# Laravel Artisan Commands Shortcut
function art($arg1,$arg2,$arg3,$arg4,$arg5) { php artisan $arg1 $arg2 $arg3 $arg4 $arg5}
Set-Alias a art
#### Use as by default Alias #####
# ge:r => generate:resource
# ge:c => generate:controller
# ge:s => generate:seed
# ge:m => generate:model
# ge:sc => generate:scaffold
# m:m => migrate:make
# m:f => migrate:refresh
# m:re => migrate:reset
# m:b => migrate:rollback
# Try it
## PS c:\laravel_proj> a ge:r post
# For CodeCept
## Assuming codecept.phar file is in your current working Directory
function codecept($arg1,$arg2) { php codecept.phar $arg1 $arg2 }
Set-Alias c codecept
# *** Other *** #
function www($arg1) {
$arg="c:/xampp/htdocs/" + $arg1
cd $arg
}
## Try it:
# PS C:\> www
# OR,
# PS C:\> www laravel_proj
@Keno-Chile
Copy link

❯ a route:list
a: The term 'php artisan' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

@Ilove-Heng
Copy link

Ilove-Heng commented Mar 8, 2023

Check out my command for PowerShell to alias on the windows

Set-Alias -name cps -value composer
function lab { cd "C:\Users\Nang Seakheng\.ssh" }

function art($arg1,$arg2,$arg3,$arg4,$arg5) { php artisan $arg1 $arg2 $arg3 $arg4 $arg5}

Set-Alias a art

function www($arg1) {
    $arg="c:/xampp/htdocs/" + $arg1
    cd $arg
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment