public function toJSON(Builder $query)
    {
        file_put_contents(
            $file = $this->getFilename(),
            json_encode($this->exportableQuery($query)->get())
        );

        return $this->sendDownloadResponse($file, 'json', ['Content-Type' => 'application/json']);
    }