App\Console\Commands\Site::handle PHP Method

handle() public method

Execute the console command.
public handle ( ) : mixed
return mixed
    public function handle()
    {
        $siteKey = $this->option('siteKey');
        $host = $this->option('host');
        $handler = $this->handler;
        try {
            $host = $this->validateHost($host);
            /** @var SiteModel $site */
            $site = SiteModel::find($siteKey);
            $site->host = $host;
            $handler->put($site);
            $this->comment($this->description);
        } catch (NotFoundSiteException $e) {
            $this->comment("Cannot find site information. (find key :{$siteKey})");
        } catch (InvalidArgumentException $e) {
            $this->comment("{$host} is incorrect host format. ex) example.com ");
        }
    }