Execute the job.

@throws \Throwable
347102
public function handle()
    {

        if (! $this->preflighted()) return;

        $orders = $this->retrieve([
            'character_id' => $this->getCharacterId(),
        ]);

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

        collect($orders)->each(function ($order) {

            CharacterOrder::firstOrNew([
                'character_id' => $this->getCharacterId(),
                'order_id'     => $order->order_id,
            ])->fill([
                'type_id'        => $order->type_id,
                'region_id'      => $order->region_id,
                'location_id'    => $order->location_id,
                'range'          => $order->range,
                'is_buy_order'   => $order->is_buy_order ?? null,
                'price'          => $order->price,
                'volume_total'   => $order->volume_total,
                'volume_remain'  => $order->volume_remain,
                'issued'         => carbon($order->issued),
                'min_volume'     => $order->min_volume ?? null,
                'duration'       => $order->duration,
                'is_corporation' => $order->is_corporation,
                'escrow'         => $order->escrow ?? null,
            ])->save();
        });
    }
909206
public function handle()
    {
        $content = file_get_contents(RESOURCE.'migrations/controller.php.dist');

        $generator = new TemplateGenerator($content);
        $name = $this->argument('name');

        $path = HTTP.'Controllers/'.$name.'.php';
        $generated = $generator->generate(['name' => $name]);
        if (!$this->filesystem->exists($path)) {
           $this->filesystem->create($path);
            $this->filesystem->put($path, $generated);
            $this->info(sprintf('%s created succesfully to %s', $name, $path));
        } else {
            $this->error(sprintf('%s Controller already exists', $name));
        }
    }
1368446
public function handle()
    {
        $input = $this->getCommandInput();

        if ($this->isRouteNameExists($this->getDotNotationName($this->getModelName($input->modelName), $input->prefix, 'index'))) {
            $this->warn("The routes already registered!");
            return;
        }

        $routesFile = $this->getRoutesFileName();

        if (!$this->isFileExists($routesFile)) {
            throw new Exception("The routes file does not exists. The expected location was " . $routesFile);
        }

        $stub = $this->getStubContent('routes');

        $controllnerName = $this->getControllerName($input->controllerName, $input->controllerDirectory);

        $this->replaceModelName($stub, $input->modelName)
            ->replaceControllerName($stub, $controllnerName)
            ->replaceRouteNames($stub, $this->getModelName($input->modelName), $input->prefix)
            ->processRoutesGroup($stub, $input->prefix, $input->controllerDirectory)
            ->appendToRoutesFile($stub, $routesFile)
            ->info('The routes were added successfully.');
    }
449487
public function run()
	{
		$context = $this->_getContext();

		$jobManager = MAdmin_Job_Manager_Factory::createManager( $context );
		$criteria = $jobManager->createSearch( true );

		$start = 0;

		do
		{
			$items = $jobManager->searchItems( $criteria );

			foreach( $items as $item )
			{
				try
				{
					$job = $item->getMethod();

					if( preg_match( '/^[a-zA-Z0-9\_]+\.[a-zA-Z0-9\_]+$/', $job ) !== 1 ) {
						throw new Controller_Jobs_Exception( sprintf( 'Invalid characters in job name "%1$s"', $job ) );
					}

					$parts = explode( '.', $job );

					if( count( $parts ) !== 2 ) {
						throw new Controller_Jobs_Exception( sprintf( 'Invalid job method "%1$s"', $job ) );
					}

					$name = "Controller_ExtJS_{$parts[0]}_Factory";
					$method = $parts[1];

					if( class_exists( $name ) === false ) {
						throw new Controller_Jobs_Exception( sprintf( 'Class "%1$s" not available', $name ) );
					}

					$name .= '::createController';

					if( ( $controller = call_user_func_array( $name, array( $context ) ) ) === false ) {
						throw new Controller_Jobs_Exception( sprintf( 'Unable to call factory method "%1$s"', $name ) );
					}

					if( method_exists( $controller, $method ) === false ) {
						throw new Controller_Jobs_Exception( sprintf( 'Method "%1$s" not available', $method ) );
					}

					$result = $controller->$method( (object) $item->getParameter() );

					$item->setResult( $result );
					$item->setStatus( -1 );
				}
				catch( Exception $e )
				{
					$str = 'Error while processing job "%1$s": %2$s';
					$context->getLogger()->log( sprintf( $str, $item->getMethod(), $e->getMessage() ) );
					$item->setStatus( 0 );
				}

				$jobManager->saveItem( $item );
			}

			$count = count( $items );
			$start += $count;
			$criteria->setSlice( $start );
		}
		while( $count > 0 );
	}
656622
public function handle()
    {
        foreach ($this->schedule->dueEvents($this->laravel) as $event) {
            if (! $event->filtersPass($this->laravel)) {
                continue;
            }

            if ($event->onOneServer) {
                $this->runSingleServerEvent($event);
            } else {
                $this->runEvent($event);
            }

            $this->eventsRan = true;
        }

        if (! $this->eventsRan) {
            $this->info('No scheduled commands are ready to run.');
        }
    }
937468
public function handle()
    {

        $this->line('SeAT Diagnostics');
        $this->line('If you are not already doing so, it is recommended that you ' .
            'run this as the user the workers are running as.');
        $this->line('Eg:');
        $this->info('    sudo -u apache php artisan seat:admin:diagnose');
        $this->info('    su -c "php artisan seat:admin:diagnose" -s /bin/sh www-data');
        $this->line('This helps to check whether the permissions are correct.');
        $this->line('');

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

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

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

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

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

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

        $this->call('seat:version');

        $this->line('SeAT Diagnostics complete');

    }
364221
public function handle(): void
    {
        collect(Artisan::all())->filter(function ($command) {
            return mb_strpos($command->getName(), 'cortex:rollback:') !== false;
        })->partition(function ($command) {
            return in_array($command->getName(), ['cortex:rollback:foundation', 'cortex:rollback:auth']);
        })->flatten()->each->run(new ArrayInput(['--force' => $this->option('force')]), $this->output);
    }
852364
public function handle()
    {
        $app = new ApplicationHook($this->laravel);

        $instances = $app->getInstances();
        $objects = $app->getBindings();
        $aliases = [];

        foreach ($app->getAliases() as $alias => $abstract) {
            $aliases[$abstract][] = $alias;
        }

        ksort($objects);

        foreach ($objects as $name => $instance) {
            $this->info($name.': ');

            if (is_array($instance)) {
                if ($instance['shared']) {
                    $this->output(array_get($instances, $name));
                }
                else {
                    $this->output($instance['concrete']);
                }
            }
            else {
                $this->output($instance);
            }

            if (isset($aliases[$name])) {
                foreach ($aliases[$name] as $value) {
                    $this->line("\t[alias] \"$value\"\n");
                }
            }
        }
    }
1143248
public function handle()
    {
        $name = $this->argument('name');

        //
        // Model - Controller - (Policy)
        //

        $this->call('make:model', ['name' => $name]);

        $this->call('make:controller', ['name' => $name.'Controller', '--model' => $name]);

        // Conditionally create policy
        if ($this->anticipate('Would you like to create a policy for this resource?', ['yes', 'no']) == 'yes') {
            $this->call('make:policy', ['name' => $name.'Policy', '-m' => $name]);
        }

        //
        // Migration - (Seed)
        //

        $migrationName = 'create_' . str_plural(snake_case($name)) . '_table';
        $this->call('make:migration', ['name' => $migrationName]);

        // Conditionally create seeder
        if ($this->anticipate('Would you like to create a Seeder for this resource?', ['yes', 'no']) == 'yes') {
            $this->call('make:seeder', ['name' => str_plural($name) . 'Seeder']);
        }

        // @todo: Add seeder class to DatabaseSeeder.php
    }
923727
public function handle()
	{
		parent::handle();

		$followRepoPattern = $this->confirm("\nDo you want to generate repository ? (y|N)", false);

		$migrationGenerator = new MigrationGenerator($this->commandData);
		$migrationGenerator->generate();

		$modelGenerator = new ModelGenerator($this->commandData);
		$modelGenerator->generate();

		if($followRepoPattern)
		{
			$repositoryGenerator = new RepositoryGenerator($this->commandData);
			$repositoryGenerator->generate();

			$repoControllerGenerator = new RepoAPIControllerGenerator($this->commandData);
			$repoControllerGenerator->generate();
		}
		else
		{
			$controllerGenerator = new APIControllerGenerator($this->commandData);
			$controllerGenerator->generate();
		}

		$routeGenerator = new RoutesGenerator($this->commandData);
		$routeGenerator->generate();

		if($this->confirm("\nDo you want to migrate database? [y|N]", false))
			$this->call('migrate');
	}
1175419
public function handle()
    {

        if (! $this->preflighted()) return;

        $stats = $this->retrieve([
            'character_id' => $this->getCharacterId(),
        ]);

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

        // Process each years aggregate
        collect($stats)->each(function ($aggregate) {

            // Separate stats by categories
            foreach (['character', 'combat', 'industry', 'inventory', 'isk', 'market',
                         'mining', 'module', 'orbital', 'pve', 'social', 'travel', ] as $category) {

                CharacterStats::firstOrCreate([
                    'character_id' => $this->getCharacterId(),
                    'year'         => $aggregate->year,
                    'category'     => $category,
                    'stats'        => isset($aggregate->$category) ?
                        json_encode($aggregate->$category) : null,
                ]);
            }
        });
    }
12692
public function handle()
    {
        $filesystem = new Filesystem;
        $filesystem->copyDirectory(
            __DIR__ . '/stubs/install',
            base_path()
        );
        $this->call('storage:link');

        if ($this->option('migrate')) {
            $this->call('migrate', ['--path' => str_replace(base_path(), '', __DIR__) . '/../../migrations']);
            $this->call('db:seed', ['--class' => \Kaiwh\Admin\Seeds\InitAdminSeeder::class]);
        }
    }
927314
public function handle()
    {
        $this->resource = $this->getResourceOnly();
        $this->settings = config('generators.defaults');

        $this->callModel();
        $this->callView();
        $this->callRepository();
        $this->callController();
        $this->callMigration();
        $this->callSeed();
        $this->callMigrate();

        // confirm dump autoload
        if ($this->confirm("Run 'composer dump-autoload'?")) {
            $this->composer->dumpAutoloads();
        }

        $this->info('All Done!');
        $this->info('Remember to add ' . "`Route::resource('" . str_replace('_', '-',
                $this->getCollectionName()) . "', '" . $this->getResourceControllerName() . "');`" . ' in `routes\\web.php`');
    }
132346
public function handle()
    {
        $filename = $this->option('filename');
        $this->write = $this->option('write');
        $this->dirs = array_merge(
            $this->laravel['config']->get('ide-helper.model_locations'),
            $this->option('dir')
        );
        $model = $this->argument('model');
        $ignore = $this->option('ignore');
        $this->reset = $this->option('reset');
        if ($this->option('smart-reset')) {
            $this->keep_text = $this->reset = true;
        }
        $this->write_model_magic_where = $this->laravel['config']->get('ide-helper.write_model_magic_where', true);

        //If filename is default and Write is not specified, ask what to do
        if (!$this->write && $filename === $this->filename && !$this->option('nowrite')) {
            if ($this->confirm(
                "Do you want to overwrite the existing model files? Choose no to write to $filename instead?"
            )
            ) {
                $this->write = true;
            }
        }

        $content = $this->generateDocs($model, $ignore);

        if (!$this->write) {
            $written = $this->files->put($filename, $content);
            if ($written !== false) {
                $this->info("Model information was written to $filename");
            } else {
                $this->error("Failed to write model information to $filename");
            }
        }
    }
62510
public function handle()
    {
        \tap($this->tenant->driver($this->getDriver()), function ($migrator) {
            $this->setupMigrationOutput($migrator);

            $migrator->install(
                $this->option('database'), $this->option('id')
            );
        });
    }
177999
public function handle()
    {
        $routeCollection = $this->router->getRoutes();
        $verb = $this->option('method') == 'null' ? null : strtoupper($this->option('method'));

        if ($routeCollection) {
            foreach ($routeCollection as $route) {
                if (! $verb || in_array($verb, $route->getMethods())) {
                    $info = $route->getPath();
                    if ($this->option('showMethods')) {
                        $info .= ' [' . implode(', ', $route->getMethods()) . ']';
                    }
                    $this->info($info);
                }
            }
        }
    }
823593
public function handle()
    {
        $queue = trim($this->argument('queue'));

        $this->listener = $this->di->get(Listener::class, [$queue]);

        $this->listenForEvents();

        $this->runWorker();
    }