Artisan is Laravel's command-line tool used to perform various tasks.

Create Custom Artisan Command:

Create a command:

php artisan make:command GoodMorningCommand
app/
 └── Console/
      └── Commands/
            └── GoodMorningCommand.php

app/Console/Commands/GoodMorningCommand.php

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class GoodMorningCommand extends Command
{
    // Command name
    protected $signature = 'good:morning';

    // Description
    protected $description = 'Display Good Morning Message';

    // Command logic
    public function handle()
    {
        $this->info("Good Morning!");
    }
}

Run Command:

php artisan good:morning

A custom Artisan command is a command created by the developer to automate application-specific tasks. It is created using php artisan make:command, the logic is written inside the handle() method, and it is executed using php artisan <command-name>.