Artisan là giao diện dòng lệnh của Laravel để tự động hóa các tác vụ phổ biến.
- Các lệnh thiết yếu:
php artisan migrate(chạy migration),php artisan make:controller UserController(tạo controller),php artisan make:model User(tạo model),php artisan serve(khởi động server dev),php artisan tinker(shell tương tác để test),php artisan route:list(xem tất cả route),php artisan cache:clear(xóa cache). - Artisan tiết kiệm thời gian bằng cách tự động hóa các tác vụ lặp đi lặp lại và đảm bảo tính nhất quán trong việc tạo code.
Artisan is Laravel's command-line interface for common tasks.
- Essential commands:
php artisan migrate(run database migrations),php artisan make:controller UserController(create controller),php artisan make:model User(create model),php artisan serve(start development server),php artisan tinker(interactive shell for testing),php artisan route:list(show all routes),php artisan cache:clear(clear cache). - Artisan saves time automating repetitive tasks and enforces consistent code generation.