<commit_before><?php namespace PandaLove\Http\Controllers;

use Illuminate\Contracts\Auth\Guard;
use Onyx\Account;
use Onyx\Destiny\Helpers\String\Hashes;
use Onyx\Halo5\Objects\Data as Halo5Data;
use Onyx\Destiny\Objects\Data as DestinyData;
use PandaLove\Http\Requests;
use Onyx\Halo5\Client as Halo5Client;
use Onyx\Destiny\Client as DestinyClient;
use PandaLove\Commands\UpdateDestinyAccount;
use PandaLove\Commands\UpdateHalo5Account;
use PandaLove\Http\Requests\AddHalo5GamertagRequest;
use PandaLove\Http\Requests\AddDestinyGamertagRequest;

class AccountController extends Controller {

    public function __construct(Guard $auth)
    {
        parent::__construct();
    }

    //---------------------------------------------------------------------------------
    // GET
    //---------------------------------------------------------------------------------

    public function getIndex()
    {
        $recent_h5 = Halo5Data::with('account', 'warzone')->orderBy('created_at')->limit(5)->get();
        $recent_destiny = DestinyData::with('account', 'characters')->orderBy('created_at')->limit(5)->get();

        // attempt hash cache
        Hashes::cacheDataHashes($recent_destiny);

        return view('account.index', [
            'title' => 'PandaLove Account Adder',
            'h5' => $recent_h5,
            'destiny' => $recent_destiny
        ]);
    }

    //---------------------------------------------------------------------------------
    // POST
    //---------------------------------------------------------------------------------

    public function postAddHalo5Gamertag(AddHalo5GamertagRequest $request)
    {
        try<commit_msg>[ci skip] we want the most recent players<commit_after><?php namespace PandaLove\Http\Controllers;

use Illuminate\Contracts\Auth\Guard;
use Onyx\Account;
use Onyx\Destiny\Helpers\String\Hashes;
use Onyx\Halo5\Objects\Data as Halo5Data;
use Onyx\Destiny\Objects\Data as DestinyData;
use PandaLove\Http\Requests;
use Onyx\Halo5\Client as Halo5Client;
use Onyx\Destiny\Client as DestinyClient;
use PandaLove\Commands\UpdateDestinyAccount;
use PandaLove\Commands\UpdateHalo5Account;
use PandaLove\Http\Requests\AddHalo5GamertagRequest;
use PandaLove\Http\Requests\AddDestinyGamertagRequest;

class AccountController extends Controller {

    public function __construct(Guard $auth)
    {
        parent::__construct();
    }

    //---------------------------------------------------------------------------------
    // GET
    //---------------------------------------------------------------------------------

    public function getIndex()
    {
        $recent_h5 = Halo5Data::with('account', 'warzone')->orderBy('created_at', 'DESC')->limit(5)->get();
        $recent_destiny = DestinyData::with('account', 'characters')->orderBy('created_at', 'DESC')->limit(5)->get();

        // attempt hash cache
        Hashes::cacheDataHashes($recent_destiny);

        return view('account.index', [
            'title' => 'PandaLove Account Adder',
            'h5' => $recent_h5,
            'destiny' => $recent_destiny
        ]);
    }

    //---------------------------------------------------------------------------------
    // POST
    //---------------------------------------------------------------------------------

    public function postAddHalo5Gamertag(AddHalo5GamertagRequest $request)
    {
        try
{'fraction_non_alphanumeric': 0.2922804949911609, 'fraction_numerical': 0.008249852681202121, 'mean_word_length': 1.65234375, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6948600', 'n_tokens_mistral': 922, 'n_tokens_neox': 896, 'n_words': 156}