Execute the job.

@throws \Throwable
550393
public function handle()
    {

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

        while (true) {

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

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

            collect($mining)->each(function ($ledger_entry) {

                // retrieve daily mined amount for current type, system and character
                $row = CharacterMining::select(DB::raw('SUM(quantity) as quantity'))
                    ->where('character_id', $this->getCharacterId())
                    ->where('date', $ledger_entry->date)
                    ->where('solar_system_id', $ledger_entry->solar_system_id)
                    ->where('type_id', $ledger_entry->type_id)
                    ->first();

                // get the current UTC time for potential new mining ledger entry
                $delta_time = carbon()->setTimezone('UTC')->toTimeString();

                // compute delta between daily knew mined amount and new daily mined amount
                $delta_quantity = $ledger_entry->quantity - (is_null($row) ? 0 : $row->quantity);

                // in case delta is 0, we skip the entry since there are no needs to store empty value
                if ($delta_quantity != 0) {

                    // in case the entry date does not match with the current date, we reset entry time to midnight as
                    // a last entry
                    if ($ledger_entry->date != carbon()->setTimezone('UTC')->toDateString())
                        $delta_time = '23:59:59';

                    // finally, we create the new entry
                    CharacterMining::updateOrCreate([
                        'character_id'    => $this->getCharacterId(),
                        'date'            => $ledger_entry->date,
                        'time'            => $delta_time,
                        'solar_system_id' => $ledger_entry->solar_system_id,
                        'type_id'         => $ledger_entry->type_id,
                    ], [
                        'quantity' => $delta_quantity,
                    ]);

                }

                // Set Historical Price
                $this->getHistoricalPrice($ledger_entry->type_id, $ledger_entry->date);

            });

            if (! $this->nextPage($mining->pages))
                break;
        }
    }
69053
public function handle(): void
    {
        $name = $this->getNameInput();

        $path = app_path($name);

        // First we will check to see if the class already exists. If it does, we don't want
        // to create the class and overwrite the user's code. So, we will bail out so the
        // code is untouched. Otherwise, we will continue generating this class' files.
        if ($this->files->exists($path)) {
            $this->error($this->type.' already exists!');

            return;
        }

        // Next, we will generate the path to the location where this class' file should get
        // written. Then, we will build the class and make the proper replacements on the
        // stub files so that it gets the correctly formatted namespace and class name.
        $stubs = __DIR__.'/../../../resources/stubs/module';
        $this->processStubs($stubs, $path);
        $this->generateSamples();

        $this->info($this->type.' created successfully.');
    }
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');

    }
1081272
public function handle()
    {
        $modelsOnly  = (bool) $this->option('models-only');
        $dryRun      = (bool) $this->option('dry-run');
        $interactive = ! (bool) $this->option('auto');

        $this->listenForLogEvents();

        $generator = new Generator( ! $dryRun, $this);

        $generator->generate();

        $this->info('Done.');
    }
1209051
public function handle()
    {

        if ($class = $this->option('class')) {
            $classes = [$class];
        } else {
            $directory = $this->option('dir') ?: app_path();
            $classes = (new FindCacheableClasses($directory))->getAllCacheableClasses();
        }
        foreach ($classes as $className) {
            $this->rebuild($className);
        }
    }
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 );
	}
670161
public function handle()
    {
        if ($this->isCli()) {
            $artisan = base_path('artisan');
            while (true) {
                set_time_limit(0);
                ini_set('max_execution_time', 0);
                ignore_user_abort();
                $process = new Process("php {$artisan} queue:work database --queue email,sms,install");
                $process->run();
                echo ($process->isSuccessful()) ? $process->getOutput() : $process->getErrorOutput();
                unset($process);
                sleep(1);
            }
        } else {
            foreach ($this->getQueues() as $queue) {
                Artisan::call('queue:work', $this->getParams($queue));
            }
            $this->info('Queue command finished.');
        }
    }
737945
public function handle()
    {

        // Ask what command
        $command = $this->choice('What command are you running?', $this->availableCommands->toArray());

        if (!$this->availableCommands->has($command)) {
            $this->info('The specified command does not exist.');
            return;
        }

        $method = 'make' . ucfirst($command);
        call_user_func([$this, $method]);

        $this->call('make:'. $command, $this->options);
    }
732619
public function handle()
    {
        $cmd = collect(array_merge($this->getSeleniumDefaultCommand(), $this->getArguments()))
            ->except('driver', 'serverVersion')
            ->implode(' ');

        $this->info('Starting Selenium server v'.$this->argument('serverVersion'));
        $this->info("Using {$this->argument('driver')} driver");

        echo shell_exec($cmd.' '.$this->getSeleniumOptions());
    }
1288968
public function handle(): void
    {
        $this->initCommands();

        foreach ($this->calls as $info) {
            if (! isset($info['command'])) {
                continue;
            }

            $params = (isset($info['params'])) ? $info['params'] : [];

            $this->line(PHP_EOL.$info['description']);

            switch ($info['type']) {
                case 'artisan':
                    $this->call($info['command'], $params);
                    break;
                case 'cli':
                    $process = new Process($info['command']);
                    $process->run();
                    break;
            }
        }
    }
63946
public function handle()
    {
        // We need to get the right queue for the connection which is set in the queue
        // configuration file for the application. We will pull it based on the set
        // connection being run for the queue operation currently being executed.
        $queue = $this->getQueue(
            $connection = $this->input->getArgument('connection')
        );

        $this->listener->listen(
            $connection, $queue, $this->gatherOptions()
        );
    }
760429
public function handle()
    {
        $packageName = $this->argument('name');

        if ($this->option('confirm')) {
            if (!$this->confirm("Do you want to install the {$packageName} package template right now? [yes|no]",
                true)
            ) {
                $this->comment("Package installation aborted by user.");

                return self::INSTALL_FAIL;
            }
        }

        if ($this->templateStorageEngine->packageExists($packageName)) {
            if (!$this->confirm("The package {$packageName} is already installed. Would you like to update it instead? [yes|no]",
                false)
            ) {
                $this->comment("The package {$packageName} is already installed and will not be updated.");

                return self::INSTALL_SUCCESS;
            } else {
                $this->comment("Okay, we will update the {$packageName} package template. Give us a moment to get things ready...");
                $this->call('template:update', ['name' => $packageName]);

                return self::INSTALL_SUCCESS;
            }
        }

        $this->line("Installing {$packageName}. Sit back and relax for a minute, this can take a while.");
        $this->templateStorageEngine->addPackage($packageName);
        $this->info("{$packageName} installed.");
        return self::INSTALL_SUCCESS;
    }
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.');
        }
    }
890979
public function handle()
    {
        if ($this->laravel['queue.failer']->forget($this->argument('id'))) {
            $this->info('Failed job deleted successfully!');
        } else {
            $this->error('No failed job matches the given ID.');
        }
    }
254023
public function handle()
    {
        $this->info('Generating optimized class loader');

        if ($this->option('psr')) {
            $this->composer->dumpAutoloads();
        } else {
            $this->composer->dumpOptimized();
        }

        $this->call('clear-compiled');
    }
808956
public function handle()
    {
        $seed = new DatabaseSeeder();
        $seed->run();

        $this->line("Seeding: RoleTableSeeder");
        //$this->line("Seeding: UserTableSeeder");
        $this->line("Seeding: BannerTableSeeder");
        $this->line("Seeding: PageTableSeeder");
        $this->line("Seeding: NavigationAdminTableSeeder");
        $this->info("Database seeding completed successfully.");

        //$this->line("User Credentials");
        //$this->info("Email: admin@laravel.local");
        //$this->info("Password: admin");
    }
823593
public function handle()
    {
        $queue = trim($this->argument('queue'));

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

        $this->listenForEvents();

        $this->runWorker();
    }