<commit_before><?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Page;
use Carbon\Carbon;

class PageController extends Controller
{

  public function index () {

    $pages = Page::with('type')->get();

    return view('dashboard/pages/index', compact('pages'));
  }

  public function store (Request $req) {
    $page = new Page();
    $page['name'] = $req['name'];
    $page['desc'] = $req['page-desc'];
    $page['type_id'] = $req['type'];
    $page['url'] = $req['url'];

    $this->validate($req, [
      'name' => 'required|unique:pages,url',
      'type' => 'required|integer',
      'url' => 'required|unique:pages,url|not_in:cms,/cms',
    ]);

    $page->save();

    return redirect()->action('PageController@index')->with('success', 'Page is created');
  }
<commit_msg>Pagination pages<commit_after><?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Page;
use Carbon\Carbon;

class PageController extends Controller
{

  public function index () {

    $pages = Page::with('type')->paginate(2);

    return view('dashboard/pages/index', compact('pages'));
  }

  public function store (Request $req) {
    $page = new Page();
    $page['name'] = $req['name'];
    $page['desc'] = $req['page-desc'];
    $page['type_id'] = $req['type'];
    $page['url'] = $req['url'];

    $this->validate($req, [
      'name' => 'required|unique:pages,url',
      'type' => 'required|integer',
      'url' => 'required|unique:pages,url|not_in:cms,/cms',
    ]);

    $page->save();

    return redirect()->action('PageController@index')->with('success', 'Page is created');
  }

{'fraction_non_alphanumeric': 0.20994475138121546, 'fraction_numerical': 0.0006138735420503376, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '4426213', 'n_tokens_mistral': 542, 'n_tokens_neox': 532, 'n_words': 101}