Laravel Command List

Laravel Command List

Artisan is  "command line interface" using in Laravel. It provides lots of helpful commands for you while developing your application. We can run these command according to our need.

    For getting laravel version
    php artisan --version
    For getting laravel list
    php artisan list;
    For help
    php artisan help;
    For Enable maintenance mode
    php artisan down;

    For Disable maintenance mode
    php artisan up;
    For creating controller
    php artisan make:controller ControllerName ;
    For creating resource controller (CRUD operation)
    The controller will contain a method of resource operations – index(), create(), store(), show(), edit(), update(), destroy()..
    php artisan make:controller HomeController--resource
    This controller generate only 5 methods: index(), store(), show(), update(), destroy(). Because create/edit forms are not needed for API
    php artisan make:controller HomeController--api
    For creating mail
    php artisan make:mail;
    For creating model
    php artisan make:model ModelName
    For creating model with migration
    php artisan make:model usermodel -m ;
    To create a migration
    php artisan make:migration MigrationName
    To rollback the migration.
    php artisan migrate:rollback 
    To create a middleware
    php artisan make:middleware MiddelwareName;
    For create a auth
    php artisan make:auth;
    For create a provider
    php artisan make:provider ProviderName
    To create the symbolic link from public/storage to storage/app/public,
    php artisan storage:link
    For Generates a new broadcasting channel class.
    php artisan make:channel;
    For Create a new Artisan command
    php artisan make:command CommandName ;
    For Create a new event class
    php artisan make:event EventName;
    For Create a new custom exception class
    php artisan make:exception ExceptionName;
    For Create a new model factory
    php artisan make:factory 
    For create a job class
    php artisan make:job 
    For create a job listener
    php artisan make:listener 
    For create a notification class
    php artisan make:notification 
    For create a new validation rule
    php artisan make:rule  
    For Create a new form request class
    php artisan make:request 
    For create a new seeder class
    php artisan make:seeder SeederName 
    For create a new test class
    php artisan make:test 
    For create a new Artisan command.
    php artisan make:command 
    clear cache in Laravel
    Please run below artisan commands step wise step.
    php artisan config:clear
    php artisan cache:clear
    php artisan view:clear
    php artisan route:clear
    Composer -regenerates the list of all classes that need to be included in the project
    composer dump-autoload
    Schedule a Command- Runs the scheduled commands defined in the application.
    php artisan schedule:run
    Run a Command Silently - Executes a command without outputting any messages.
    php artisan command:name --quiet
    Create a New Command with Options -Creates a new command with a specified command name.
    php artisan make:command CommandName --command=custom:command

Tags

We are Recommending you:

Leave a comment

Comments