Let's expand on the Laravel aliases in your .zshrc file to include more advanced and commonly used commands:
alias art='php artisan'
alias migrate='php artisan migrate'
alias migrate:fresh='php artisan migrate:fresh'
alias migrate:refresh='php artisan migrate:refresh'
alias migrate:rollback='php artisan migrate:rollback'
alias db:seed='php artisan db:seed'
alias tinker='php artisan tinker'
alias optimize='php artisan optimize'
alias route:clear='php artisan route:clear'
alias cache:clear='php artisan cache:clear'
alias config:clear='php artisan config:clear'
alias view:clear='php artisan view:clear'
alias queue:work='php artisan queue:work'
alias queue:listen='php artisan queue:listen'
alias schedule:run='php artisan schedule:run'
alias storage:link='php artisan storage:link'
alias key:generate='php artisan key:generate'
alias down='php artisan down'
alias up='php artisan up'
alias make:model='php artisan make:model'
alias make:controller='php artisan make:controller'
alias make:middleware='php artisan make:middleware'
alias make:command='php artisan make:command'
alias make:job='php artisan make:job'
alias make:mail='php artisan make:mail'
alias make:notification='php artisan make:notification'
alias make:policy='php artisan make:policy'
alias make:provider='php artisan make:provider'
alias make:request='php artisan make:request'
alias make:resource='php artisan make:resource'
alias make:seeder='php artisan make:seeder'
alias make:test='php artisan make:test'-
Basic Artisan Commands:
art: Short forphp artisan.migrate: Runs migrations.migrate:fresh: Drops all tables and migrates.migrate:refresh: Rolls back migrations and migrates again.migrate:rollback: Rolls back the last database migration batch.
-
Database and Seeder Commands:
db:seed: Seeds the database with records.
-
Optimization and Cache Commands:
optimize: Optimizes the framework for better performance.route:clear: Clears route cache.cache:clear: Clears application cache.config:clear: Clears configuration cache.view:clear: Clears compiled view files.
-
Queue Commands:
queue:work: Processes jobs on the queue.queue:listen: Listens to the queue and runs jobs as they come.
-
Scheduler Command:
schedule:run: Runs the Laravel scheduler.
-
Miscellaneous Commands:
storage:link: Creates a symbolic link frompublic/storagetostorage/app/public.key:generate: Generates an application key.down: Puts the application into maintenance mode.up: Takes the application out of maintenance mode.
-
Make Commands for Generating Laravel Components:
- These aliases simplify the generation of various Laravel components (
make:model,make:controller, etc.).
- These aliases simplify the generation of various Laravel components (
- Open your terminal.
- Navigate to your home directory by typing
cd ~. - Open
.zshrcin your preferred text editor (e.g.,nano ~/.zshrc). - Paste the advanced alias definitions at the end of the file.
- Save and close the file.
- To apply the changes, either restart your terminal or run
source ~/.zshrc.
Now, you can use these aliases to quickly execute Laravel commands and generate components without typing out the full php artisan command each time. Adjust or add aliases as per your specific Laravel project needs!