Friday, 2 October 2020

Commonly Used Laravel Artisan Console Commands

Commonly Used Laravel Artisan Console Commands

Laravel, the widely acclaimed PHP framework, enhances web development with its elegant syntax and comprehensive features. Among its powerful tools, the Artisan Console stands out, offering developers a suite of command-line operations to streamline project tasks. This brief article explores the commonly used Laravel Artisan Console commands, essential for efficient development workflows.

Most of the time laravel developer use allot of different laravel artisan commands, to clear caches
to run development server , creating controllers, models, and other useful artisan options.
    Key Laravel Artisan Commands

  1. php artisan cache:clear  Clear the application's cache, improving performance and ensuring fresh data is served to users.
  2. php artisan config:cache Clear the application configuration cache
  3. php artisan route:clear  Clear Application route cache
  4. php artisan view:clear  Clear Application View cache
  5. php artisan serve  Running development server
  6. php artisan serve: Launch a development server, making your application accessible at a localhost URL. This command is particularly useful for quick testing and development.
  7. php artisan make:migration create_table_name_table: Generate a new migration file for creating a database table. Migrations ensure database structure consistency across different environments.
  8. php artisan db:seed: Populate your database with seed data, an invaluable feature for testing and development purposes.
  9. php artisan tinker: Enter a REPL (Read-Eval-Print Loop) environment that allows you to interact with your Laravel application in a command-line interface, facilitating debugging and experimentation.
  1. Above list of commonly used artisan console commands will work with laravel 6,7,8 and 9, 10 and almost with all versions of laravel framework.

No comments:

Post a Comment

Laravel csrf token mismatch for ajax post request

Error "CSRF Token Mismatch" commonly occurs if tokens do not match in both sessions and sent , and received requests.CSRF token he...