App\Models\Score\Best\Model::getReplay PHP Method

getReplay() public method

public getReplay ( )
    public function getReplay()
    {
        // this s3 retrieval should probably be moved out of the model going forward
        if (!$this->replay) {
            return;
        }
        $config = config('filesystems.disks.s3');
        $client = S3Client::factory(['key' => $config['key'], 'secret' => $config['secret'], 'region' => $config['region']]);
        $adapter = new AwsS3Adapter($client, "replay-{$this->gameModeString()}");
        $s3 = new Filesystem($adapter);
        try {
            $replay = $s3->read($this->score_id);
        } catch (Exception $e) {
            $replay = null;
        }
        return $replay;
    }