<commit_before><?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use File;

class ExportController extends Controller
{
  public function __invoke(Request $request)
  {

    $urls = $request->user()->pages()->get(['url']);

    $filename = '/tmp/' . $request->user()->id . '.json';

    File::put($filename, $urls->toJson());

    return response()->download($filename);
  }
}
<commit_msg>Export rewrite<commit_after><?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Resources\Page as PageResource;

// use File;

class ExportController extends Controller
{
  public function __invoke(Request $request)
  {

    // $urls = $request->user()->pages()->get(['url']);
    //
    // $filename = '/tmp/' . $request->user()->id . '.json';
    //
    // File::put($filename, $urls->toJson());
    //
    // return response()->download($filename);

    return PageResource::collection($request->user()->pages()->with('comments')->get());
  }
}

{'fraction_non_alphanumeric': 0.2028397565922921, 'fraction_numerical': 0.0, 'mean_word_length': 3.7, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6189376', 'n_tokens_mistral': 297, 'n_tokens_neox': 299, 'n_words': 57}