<commit_before><?php

namespace Canvas\Http\Controllers;

use Exception;
use Canvas\Paginate;
use Illuminate\View\View;
use Canvas\Interfaces\TagInterface;
use Canvas\Interfaces\PostInterface;
use Illuminate\Http\RedirectResponse;
use Canvas\Http\Requests\Posts\CreateRequest;

class PostController extends Controller
{
    use Paginate;

    /**
     * @var PostInterface
     */
    protected $postInterface;

    /**
     * @var TagInterface
     */
    protected $tagInterface;

    /**
     * PostController constructor.
     *
     * @param PostInterface $postInterface
     * @param TagInterface $tagInterface
     */
    public function __construct(PostInterface $postInterface, TagInterface $tagInterface)
    {
        parent::__construct();
        $this->postInterface = $postInterface;
        $this->tagInterface = $tagInterface;
    }

    /**
     * Show all the posts.
     *
     * @return View
     */
    public function index(): View
    {
        $data = [
            'posts' => $this->paginate($this->postInterface->getByUserId(auth()->user()->id)->sortByDesc('created_at'), 1),
        ];

        return view('canvas::canvas.posts.index', compact('data'));
    }

    /**
     * Show the new post creation page.
     *
     * @return View
     */
    public function create(): View
    {
        $data = [
            'tags' => $this->tagInterface->all(),
        ];

        return view('canvas::canvas.posts.create', compact('data'));
    }

    /**
     * @param CreateRequest $request
     * @return \Illuminate\Http\RedirectResponse
     */
    public function store(CreateRequest $request): RedirectResponse
    {
        try {
            $this->postInterface->create($request->all());

            return back()->with('success', 'Post has been created');
        } catch (Exception $e) {
            return back()->with('error', 'Post has not been created');
        }
    }
}
<commit_msg>Increased default pagination<commit_after><?php

namespace Canvas\Http\Controllers;

use Exception;
use Canvas\Paginate;
use Illuminate\View\View;
use Canvas\Interfaces\TagInterface;
use Canvas\Interfaces\PostInterface;
use Illuminate\Http\RedirectResponse;
use Canvas\Http\Requests\Posts\CreateRequest;

class PostController extends Controller
{
    use Paginate;

    /**
     * @var PostInterface
     */
    protected $postInterface;

    /**
     * @var TagInterface
     */
    protected $tagInterface;

    /**
     * PostController constructor.
     *
     * @param PostInterface $postInterface
     * @param TagInterface $tagInterface
     */
    public function __construct(PostInterface $postInterface, TagInterface $tagInterface)
    {
        parent::__construct();
        $this->postInterface = $postInterface;
        $this->tagInterface = $tagInterface;
    }

    /**
     * Show all the posts.
     *
     * @return View
     */
    public function index(): View
    {
        $data = [
            'posts' => $this->paginate($this->postInterface->getByUserId(auth()->user()->id)->sortByDesc('created_at'), 10),
        ];

        return view('canvas::canvas.posts.index', compact('data'));
    }

    /**
     * Show the new post creation page.
     *
     * @return View
     */
    public function create(): View
    {
        $data = [
            'tags' => $this->tagInterface->all(),
        ];

        return view('canvas::canvas.posts.create', compact('data'));
    }

    /**
     * @param CreateRequest $request
     * @return \Illuminate\Http\RedirectResponse
     */
    public function store(CreateRequest $request): RedirectResponse
    {
        try {
            $this->postInterface->create($request->all());

            return back()->with('success', 'Post has been created');
        } catch (Exception $e) {
            return back()->with('error', 'Post has not been created');
        }
    }
}

{'fraction_non_alphanumeric': 0.1356809943034697, 'fraction_numerical': 0.0007767995857068876, 'mean_word_length': 2.397537379067722, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '1444672', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1070, 'n_words': 228}