rinvex/cortex-categories

View on GitHub
src/Console/Commands/SeedCommand.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

declare(strict_types=1);

namespace Cortex\Categories\Console\Commands;

use Illuminate\Console\Command;
use Symfony\Component\Console\Attribute\AsCommand;
use Cortex\Categories\Database\Seeders\CortexCategoriesSeeder;

#[AsCommand(name: 'cortex:seed:categories')]
class SeedCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'cortex:seed:categories';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Seed Cortex Categories Data.';

    /**
     * Execute the console command.
     *
     * @return void
     */
    public function handle(): void
    {
        $this->alert($this->description);

        $this->call('db:seed', ['--class' => CortexCategoriesSeeder::class]);

        $this->line('');
    }
}