Execute the job.

@return void
@throws \Throwable
351561
protected function job(): void
    {
        $members = $this->retrieve([
            'corporation_id' => $this->getCorporationId(),
        ]);

        if ($members->isCachedLoad()) return;

        collect($members)->each(function ($member_id) {

            CorporationMember::firstOrNew([
                'corporation_id' => $this->getCorporationId(),
                'character_id'   => $member_id,
            ])->save();

        });

        // Remove expelled members
        CorporationMember::where('corporation_id', $this->getCorporationId())
            ->whereNotIn('character_id', collect($members))
            ->delete();
    }
583637
public function handle()
    {

        if (is_null($this->argument('character_id')))
            $this->warn('No character id specified. Using null token.');
        else
            $refresh_token = RefreshToken::findOrFail($this->argument('character_id'));

        $this->argument('job_class')::dispatch($refresh_token ?? null);
        $this->info('Job dispatched!');
    }
274449
public function handle()
    {
        if (! $this->confirmToProceed()) {
            return;
        }

        $driver = $this->getDriver();
        $database = $this->option('database');
        $id = $this->option('id');
        $pretend = $this->option('pretend', false);

        $this->prepareDatabase($driver, $database, $id);

        $migrator = $this->tenant->driver($driver);

        $this->setupMigrationOutput($migrator);

        $migrator->run($database, $id, $pretend);
    }
592023
public function handle()
    {
        $this->parseKey();

        $this->files = $this->filesFromKey();

        try {
            $this->languages = $this->getLanguages();
        } catch (InvalidArgumentException $e) {
            $this->error($e->getMessage());

            return;
        }

        $this->table(
            array_merge(['key'], $this->languages),
            $this->tableRows()
        );
    }
534937
public function handle()
    {
        $totalThreadCount = 0;
        $categories = Category::all();

        foreach ($categories as $category) {
            $this->info("Updating counts for {$category->title}...");

            foreach ($category->threads as $thread) {
                $totalThreadCount++;
                Stats::updateThread($thread);
            }

            Stats::updateCategory($category);
        }

        $this->info("Updated counts on {$categories->count()} categories and {$totalThreadCount} threads.");
    }
279248
public function handle()
    {
        User::create([
            'name' => $this->ask('Name?'),
            'email' => $this->ask('Email address?'),
            'password' => bcrypt($this->secret('Password?'))
        ]);
        
        $this->info('User saved');
    }
1045166
public function handle()
    {
        $tableConfigFile = $this->input->getOption('config');
        if ($tableConfigFile && ! file_exists($tableConfigFile)) {
            throw new \Exception(sprintf('The configuration file "%s" does not exist!', $tableConfigFile));
        }

        if ($tableConfigFile) {
            $tableConfig = include_once( $tableConfigFile );
        }
        if ( ! empty( $tableConfig )) {
            self::$tables = $tableConfig;
        }

        $this->createTables();
    }
966864
public function handle()
    {
        $target = $this->argument('target');
        $options = [
            'compress' => $this->option('compress'),
            'json' => $this->option('json'),
            'no-lib' => $this->option('no-lib'),
            'source' => $this->option('source'),
        ];

        if ($this->generator->generate($target, $options)) {
            $this->info("Created: {$target}");

            return;
        }

        $this->error("Could not create: {$target}");
    }
1253249
public function handle()
	{
		$aimeos = $this->getLaravel()->make( 'aimeos' )->get();
		$context = $this->getContext();

		$process = $context->getProcess();
		$jobs = explode( ' ', $this->argument( 'jobs' ) );
		$localeManager = \Aimeos\MShop::create( $context, 'locale' );

		foreach( $this->getSiteItems( $context, $this->argument( 'site' ) ) as $siteItem )
		{
			$localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false );
			$localeItem->setLanguageId( null );
			$localeItem->setCurrencyId( null );

			$context->setLocale( $localeItem );

			$this->info( sprintf( 'Executing the Aimeos jobs for "%s"', $siteItem->getCode() ) );

			foreach( $jobs as $jobname )
			{
				$fcn = function( $context, $aimeos, $jobname ) {
					\Aimeos\Controller\Jobs::create( $context, $aimeos, $jobname )->run();
				};

				$process->start( $fcn, [$context, $aimeos, $jobname], true );
			}
		}

		$process->wait();
	}
159578
public function handle()
    {
        $name = $this->argument('name');
        $readableName = $this->argument('readableName');
        $userId = $this->option('user');
        $roleName = $this->option('role');

        $permission = $this->createPermission($name, $readableName);

        if ($userId) {
            $this->attachPermissionToUser($permission, $userId);
        }

        if ($roleName) {
            $this->attachPermissionToRole($permission, $roleName);
        }
    }
736931
public function handle()
    {
        if (count($this->models) === 0) {
            return;
        }

        $this->models->first()->searchableUsing()->update($this->models);
    }
158369
public function handle()
    {
        $this->setArguments();
        $search = $this->ask('What string would you like to search for?');
        $replace = $this->choice('Do you want to carry out a replacement or just a search?', [ 'Search only', 'Search and replace' ] );
        $replacement = false;
        if( $replace === 'Search and replace' ) {
            $replacement = $this->ask( "What would you like to replace '{$search}' with?" );
        }
        if( $replacement ) {
            $this->searchAndReplace( $search, $replacement );
        } else {
            $this->searchOccurrences( $search );
        }
    }
1011598
public function handle()
    {

        $command = $this->argument('function') ? $this->argument('function') : 'create';
        $param = $this->argument('params') ? $this->argument('params') : '';
        if (is_callable([$this, $command])) {
            $this->$command($param);
        } else {
            $this->error(sprintf('%s command not found', $command));
        }
    }
445001
public function execute()
    {
        if ($this->state === self::STATE_WAITING) {
            $this->state = self::STATE_RUNNING;
            foreach ($this->jobs as $name => $cb) {
                $cb($name, $this);
                $this->jobs[$name] = null;
            }
            $this->checkIfAllReady();
        }
    }
245499
public function handle()
    {
        $this->install();

        $command = trim($this->option('command'));
        if (empty($command) === true) {
            $command = 'help';
        }

        $input = new StringInput($command);
        $output = $this->getOutput();
        $application = new \Composer\Console\Application();
        $application->setAutoExit(false);
        $application->run($input, $output);
    }
532797
public function handle()
    {
        $filePaths = $this->helper->getConfigFilesSorted();

        $seeds = [];

        foreach ($filePaths as $filePath) {
            $file = json_decode(file_get_contents($filePath), true);

            if (isset($file['seeder'])) {
                $seeds[] = $file['seeder'];
            }
        }

        foreach ($seeds as $class) {
            if (class_exists($class)) {
                if (app()->environment() == 'production') {
                    $this->call('db:seed', ['--class' => $class, '--force' => true]);
                } else {
                    $this->call('db:seed', ['--class' => $class]);
                }
            }
        }

        if (app()->environment() == 'production') {
            $this->call('db:seed', ['--force' => true]);
        } else {
            $this->call('db:seed');
        }
    }
848963
public function handle()
    {

        $connection = $this->option("connection") ? $this->option("connection") : config("es.default");

        $indices = $this->es->connection($connection)->raw()->cat()->indices();

        if (is_array($indices)) {
            $indices = $this->getIndicesFromArrayResponse($indices);
        } else {
            $indices = $this->getIndicesFromStringResponse($indices);
        }

        if (count($indices)) {
            $this->table($this->headers, $indices);
        } else {
            $this->warn('No indices found.');
        }

    }