Before using any type of best artisan commands in Laravel, You need to know what is it? and what you are working for? As a programmer, you need to know for what you are working? and always updated for that thing. That's a good sign as a programmer. So, let's discuss what is Laravel?
What is Laravel?
Laravel is a free, open-source web framework of PHP, created by Taylor Otwell. Specially Laravel is created for web applications, model view controllers, architectural patterns, etc. Laravel is very advanced than PHP. In this framework, you don't need to specify the perfect functions or queries for projects. You need to just write a hint and it gives hole function or query as usual in PHP.
Now let's see the best artisan commands in Laravel. You need to write make: keyword to define the commands in Laravel. Some of them have parameters that make your coding faster. Artisan Commands of Laravel are as follow:
List of Artisan Commands in Laravel
make: command Create a new Artisan command
make: controller Create a new controller class
make: event Create a new event class
make: exception Create a new custom exception class
make: factory Create a new model factory
make: job Create a new job class
make: listener Create a new event listener class
make: mail Create a new email class
make: migration Create a new migration file
make: model Create a new Eloquent model class
make: notification Create a new notification class
make: observer Create a new observer class
make: rule Create a new validation rule
make: seeder Create a new seeder class
make: test Create a new test class
1. Make: Command
Creates a new artisan command.
Example:
php artisan make: command receive emails
Parameter:
--command=Command
2. Make: Controller
Creates a new controller in app / Http / Controllers folder.
Example:
php artisan make:controller UserController
Parameter:
--resource
Basically, this controllers method will available for all resource operators like index(), create(), store(), show(), edit(), update(), destroy().
3. Make: Event
Creates a new event class
Example:
php artisan make: event OrderRecieved
Parameter:
This command doesn't have any parameters.
4. Make: Exception
Creates a new exception class.
Example:
php artisan make:exception UserAlreadyExist
Parameter:
--render
5. Make: Factory
Creates a new factory model.
Example:
php artisan make:factory PostFactory --model=Post
Parameter:
--model=Post
6. Make: Job
Creates new job class.
Example:
php artisan make: job SendReminder
Parameter:
--sync
7. Make: Listener
Creates a new event listener class
Example:
php artisan make: listener SendEmail
Parameter:
--event=Event
8. Make: Mail
Creates a new email class.
Example:
php artisan make: mail MailRecieved
Parameter:
--markdown
9. Make: Migration
Creates a new migration file.
Example:
php artisan make:migration createTable
Parameter:
--create=Table
10. Make: Model
Creates new eloquent model class.
Example:
php artisan make: model Picture
Parameter:
--migration
11. Make: Notification
creates a new notification class.
Example:
php artisan make: notification Call
Parameter:
--markdown
12. Make: Observer
Creates a new observer class.
Example:
php artisan make:observer PostObserver --model=Post
Parameter:
--model=Post
13. Make: Rule
Creates a new validation rule.
Example:
php artisan make: rule Lowercase
Parameters:
This command doesn't have parameters.
14. Make: Seeder
Creates a new seeder class.
Example:
php artisan make: seeder BooksTable
Parameter:
This command doesn't have parameters.
15. Make: Test
Creates a new test class.
Example:
php artisan make: test Test
Parameter:
--unit
Hope you enjoy the artisan commands, Have a nice day!!!
Read More:: 15 Modern ES6 Snippets For JavaScript To Make Your Code More Attractive
Read More:: 7 Best VS Code Themes 2021 - You Should Know
Tags
artisan command laravel php
artisan commands for laravel
artisan commands in laravel
artisan commands laravel
command laravel parameter
commands for laravel
php artisan command for laravel