Return a characters current Skill Queue.

@param int $character_id

@return \Illuminate\Support\Collection
10651
public function getCharacterSkillQueue(int $character_id): Collection
    {

        return CharacterSkillQueue::where('characterID', $character_id)
            ->where('queue_position', '>', 0)
            ->orderBy('queue_position')
            ->get();

    }
1240620
public function characterTopWalletJournalInteractions(Collection $character_ids): Builder
    {

        return CharacterWalletJournal::with('first_party', 'second_party')
            ->select('*', DB::raw('count(*) as total'))
            ->whereIn('character_wallet_journals.character_id', $character_ids->toArray())
            ->groupBy('first_party_id', 'second_party_id')
            ->orderBy('total', 'desc');

    }
1300053
public function getCharacterJournalStandingsWithProfile(int $character_id, int $profile_id)
    {

        return CharacterWalletJournal::select(
            DB::raw('count(*) as total'),
            'character_affiliations.character_id',
            'character_affiliations.corporation_id',
            'character_affiliations.alliance_id',
            'character_affiliations.faction_id',
            'standings_profile_standings.elementID as standing_match_on',
            'standings_profile_standings.type as standing_type',
            'standings_profile_standings.standing as standing'
        )->leftJoin('character_affiliations', function ($join) {

            $join->on(
                'character_affiliations.character_id', '=',
                'character_wallet_journals.first_party_id'
            );

            $join->orOn(
                'character_affiliations.character_id', '=',
                'character_wallet_journals.second_party_id'
            );

        })->join('standings_profile_standings', function ($join) {

            $join->on(
                'standings_profile_standings.elementID', '=',
                'character_affiliations.character_id'
            );

            $join->orOn(
                'standings_profile_standings.elementID', '=',
                'character_affiliations.corporation_id'
            );

            $join->orOn(
                'standings_profile_standings.elementID', '=',
                'character_affiliations.alliance_id'
            );

        })->where('character_wallet_journals.character_id', $character_id)
            ->where('standings_profile_standings.standings_profile_id', $profile_id)
            ->groupBy('standings_profile_standings.elementID');

    }
467948
public function getChatId($chat_id = null) {
        try {
            if ($chat_id)
                return $chat_id;

            if( isset($this->result->message) ) {
                return $this->result->message->chat->id;
            } elseif ( isset($this->result->inline_query) ) {
                return $this->result->inline_query->from->id;
            } else {
                throw new \Exception("Error Processing Request", 1);
            }
        } catch (\Exception $e) {
            error_log($e->getMessage());
        }
    }
164794
public function getTransactionContent(int $character_id, int $client_id)
    {

        $transactions = $this->characterWalletTransactionInteraction($character_id, $client_id);

        return DataTables::of($transactions)
            ->editColumn('is_buy', function ($row) {

                return view('web::partials.transactionbuysell', compact('row'));
            })
            ->editColumn('unit_price', function ($row) {

                return number($row->unit_price);
            })
            ->addColumn('item_view', function ($row) {
                return view('web::partials.transactiontype', compact('row'));
            })
            ->addColumn('total', function ($row) {

                return number($row->unit_price * $row->quantity);
            })
            ->addColumn('client_view', function ($row) {

                $character_id = $row->character_id;

                $character = CharacterInfo::find($row->client_id) ?: $row->client_id;

                return view('web::partials.character', compact('character', 'character_id'));
            })
            ->rawColumns(['is_buy', 'client_view', 'item_view'])
            ->make(true);
    }
465994
public function characterWalletJournalInteractions(int $first_party_id, int $second_party_id) : Builder
    {

        return CharacterWalletJournal::with('first_party', 'second_party')
            ->where('first_party_id', '=', $first_party_id)
            ->where('second_party_id', '=', $second_party_id);

    }
750340
public function getSheet(int $character_id)
    {

        // TODO: Revert to repository pattern.

        // Ensure we've the public information for this character
        // If not, redirect back with an error.

        // TODO : queue a job which will pull public data for this toon
        if (! $character_info = CharacterInfo::find($character_id))
            return redirect()->back()
                ->with('error', trans('web::seat.unknown_character'));

        $attributes = CharacterAttribute::find($character_id);
        $fatigue = CharacterFatigue::find($character_id);
        $employment = CharacterCorporationHistory::where('character_id', $character_id)->orderBy('record_id', 'desc')->get();
        $implants = CharacterImplant::where('character_id', $character_id)->get();
        $last_jump = CharacterClone::find($character_id);
        $jump_clones = CharacterJumpClone::where('character_id', $character_id)->get();
        $skill_queue = CharacterSkillQueue::where('character_id', $character_id)->orderBy('queue_position')->get();
        $titles = CharacterTitle::where('character_id', $character_id)->get();

        return view('web::character.sheet',
            compact('attributes', 'fatigue', 'character_info', 'employment',
                'implants', 'last_jump', 'jump_clones', 'skill_queue', 'titles'));
    }
290506
public function get_notifications_strategy( $queue_id ) {

		$all = get_option( $this->bucket, array() );

		if ( isset( $all[ $queue_id ]['strategy'] ) ) {
			return $all[ $queue_id ]['strategy'];
		} else {
			return null;
		}
	}
980786
public function getKillmailsData(int $character_id)
    {

        if (! request()->has('all_linked_characters'))
            return response('required url parameter is missing!', 400);

        if (request('all_linked_characters') === 'false')
            $character_ids = collect($character_id);

        $user_group = User::find($character_id)->group->users
            ->filter(function ($user) {
                return $user->name !== 'admin' && $user->id !== 1;
            })
            ->pluck('id');

        if (request('all_linked_characters') === 'true')
            $character_ids = $user_group;

        $killmails = $this->getCharacterKillmails($character_ids);

        return DataTables::of($killmails)
            ->addColumn('victim', function ($row) {

                if (is_null($row->killmail_victim))
                    return '';

                $character_id = $row->character_id;

                $character = CharacterInfo::find($row->killmail_victim->character_id) ?: $row->killmail_victim->character_id;
                $corporation = CorporationInfo::find($row->killmail_victim->corporation_id) ?: $row->killmail_victim->corporation_id;

                $view = view('web::partials.character', compact('character', 'character_id'))
                    . '</br>'
                    . view('web::partials.corporation', compact('corporation', 'character_id'));

                $alliance = '';

                if (! empty($row->killmail_victim->alliance_id)) {
                    $alliance = view('web::partials.alliance', ['alliance' => $row->killmail_victim->alliance_id, 'character_id' => $character_id]);
                }

                    return $view . $alliance;
            })
            ->addColumn('ship', function ($row) {

                if (is_null($row->killmail_victim))
                    return '';

                $ship_type = $row->killmail_victim->ship_type;

                return view('web::partials.killmailtype', compact('ship_type'))
                    ->render();
            })
            ->addColumn('place', function ($row) {

                if (is_null($row->killmail_detail))
                    return '';

                $place = $row->killmail_detail->solar_system;

                return view('web::partials.killmailsystem', compact('place'))
                    ->render();
            })
            ->addColumn('zkb', function ($row) {

                return view('web::partials.killmailzkb', compact('row'))
                    ->render();
            })
            ->rawColumns(['victim', 'ship', 'place', 'zkb'])
            ->make(true);

    }
38644
public function CharacterPictures(int $id): array
    {
        return $this->myanimelist->getCharacterPictures(
            new Request\Character\CharacterPicturesRequest($id)
        );
    }
773090
public function getNotesData(int $character_id)
    {

        return DataTables::of(CharacterInfo::getNotes($character_id))
            ->addColumn('actions', function ($row) {

                return view('web::character.intel.partials.notesactions', compact('row'))
                    ->render();
            })
            ->rawColumns(['actions'])
            ->make(true);

    }
1139994
public function getCharacterResearchAgents(int $character_id): Collection
    {

        return CharacterAgentResearch::join(
            'invNames',
            'character_agent_researches.agent_id', '=',
            'invNames.itemID')
            ->join(
                'invTypes',
                'character_agent_researches.skill_type_id', '=',
                'invTypes.typeID')
            ->where('character_id', $character_id)
            ->get();
    }
797122
public function getCharacterApi()
    {
        if (!$this->apis->has('character')) {
            $this->apis->set('character', new Character($this));
        }

        return $this->apis->get('character');
    }
759928
public function getCharacterMarketOrders(Collection $character_ids) : Builder
    {

        return DB::table(DB::raw('character_orders as a'))
            ->select(DB::raw(
                '
                --
                -- Select All
                --
                *,

                --
                -- Start stationName Lookup
                --
                CASE
                when a.location_id BETWEEN 66015148 AND 66015151 then
                    (SELECT s.stationName FROM staStations AS s
                      WHERE s.stationID = a.location_id-6000000)
                when a.location_id BETWEEN 66000000 AND 66014933 then
                    (SELECT s.stationName FROM staStations AS s
                      WHERE s.stationID = a.location_id-6000001)
                when a.location_id BETWEEN 66014934 AND 67999999 then
                    (SELECT d.name FROM `sovereignty_structures` AS c
                      JOIN universe_stations d ON c.structure_id = d.station_id
                      WHERE c.structure_id = a.location_id-6000000)
                when a.location_id BETWEEN 60014861 AND 60014928 then
                    (SELECT d.name FROM `sovereignty_structures` AS c
                      JOIN universe_stations d ON c.structure_id = d.station_id
                      WHERE c.structure_id = a.location_id)
                when a.location_id BETWEEN 60000000 AND 61000000 then
                    (SELECT s.stationName FROM staStations AS s
                      WHERE s.stationID = a.location_id)
                when a.location_id >= 61000000 then
                    (SELECT d.name FROM `sovereignty_structures` AS c
                      JOIN universe_stations d ON c.structure_id = d.station_id
                      WHERE c.structure_id = a.location_id)
                else (SELECT m.itemName FROM mapDenormalize AS m
                    WHERE m.itemID = a.location_id) end
                    AS stationName'))
            ->join(
                'invTypes',
                'a.type_id', '=',
                'invTypes.typeID')
            ->whereIn('a.character_id', $character_ids);

    }
818595
public function getPi(int $character_id)
    {

        $colonies = $this->getCharacterPlanetaryColonies($character_id);
        $extractors = $this->getCharacterPlanetaryExtractors($character_id);

        // TODO: Complete the Links and stuff™

        return view('web::character.pi', compact('colonies', 'extractors'));
    }
254104
public function getTopTransactionsData(int $character_id)
    {
        if (! request()->has('all_linked_characters'))
            return abort(500);

        $character_ids = collect($character_id);

        $user_group = User::find($character_id)->group->users
            ->filter(function ($user) {
                return $user->name !== 'admin' && $user->id !== 1;
            })
            ->pluck('id');

        if (request('all_linked_characters') === 'true')
            $character_ids = $user_group;

        $top = $this->characterTopWalletTransactionInteractions($character_ids);

        return DataTables::of($top)
            ->addColumn('character', function ($row) {

                return $this->getIntelView('character', $row->character_id, $row->client_id);
            })
            ->addColumn('corporation', function ($row) {

                return $this->getIntelView('corporation', $row->character_id, $row->client_id);
            })
            ->addColumn('alliance', function ($row) {

                return $this->getIntelView('alliance', $row->character_id, $row->client_id)
                    . view('web::character.intel.partials.transactioncontentbutton', compact('row'));
            })
            ->rawColumns(['character', 'corporation', 'alliance'])
            ->make(true);

    }
1004549
public function getMethod($uid, $employee_id)
    {
        $result = $this->getMethodInternal(compact('uid', 'employee_id'));
        $statusCode = (int)$result[ 'statusCode' ];

        if ($statusCode === 200) {
            return $this->getResultAsArrayWithoutStatusCode($result);
        }

        $this->reportUnexpectedResponse($result, 1541006615);
    }