HEX
Server: nginx/1.28.3
System: Linux lightweb-s1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64
User: drdrivek-71 (1047)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: /home/eslinced-103/brise-edu.or.kr/app/Commands/SeedCommand.php
<?php

namespace App\Commands;

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;

class SeedCommand extends Command
{
    use NovaPackageCommand;

    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'amuz-cms:seed';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Run package seeder';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $package = $this->argument('package');

        $seeder = "{$this->namespace($package)}\\Database\\Seeders\\{$this->studly($package)}DatabaseSeeder";

        if(class_exists($seeder)){
            $this->call('db:seed', ['--class' => $seeder]);
            $this->info("{$this->studly($package)} : Seeding done");
        }else{
            $this->error("Error during seeding. Class {$seeder} doesn't exists.");
        }
    }

    /**
     * Get the console command arguments.
     *
     * @return array
     */
    protected function getArguments()
    {
        return [
            ['package', InputArgument::REQUIRED, "Package name"],
        ];
    }

}