Last active
May 21, 2024 06:26
-
-
Save abhishekkhaware/7152721 to your computer and use it in GitHub Desktop.
Create An Alias For Laravel and Codecept in Windows PowerShell.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
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
❯ 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.