<commit_before><?php

namespace Atsys\Blog\Http\Controllers\Blog;

use App\Http\Controllers\Controller;
use Atsys\Blog\Post;
use Atsys\Blog\PostCategory;

class PostsController extends Controller
{
    public function index()
    {
        $posts = Post::with('postCategory')->latest()->paginate(10);

        $latest_posts = Post::latest()->take(5);

        $categories = PostCategory::has('posts')->latest()->get()->sortBy('title_translated');

        return view('blog::frontend.posts.index', compact('posts', 'latest_posts', 'categories'));
    }
}<commit_msg>Fix bug querying latest posts<commit_after><?php

namespace Atsys\Blog\Http\Controllers\Blog;

use App\Http\Controllers\Controller;
use Atsys\Blog\Post;
use Atsys\Blog\PostCategory;

class PostsController extends Controller
{
    public function index()
    {
        $posts = Post::with('postCategory')->latest()->paginate(10);

        $latest_posts = Post::latest()->take(5)->get();

        $categories = PostCategory::has('posts')->latest()->get()->sortBy('title_translated');

        return view('blog::frontend.posts.index', compact('posts', 'latest_posts', 'categories'));
    }
}
{'fraction_non_alphanumeric': 0.17142857142857143, 'fraction_numerical': 0.005194805194805195, 'mean_word_length': 4.504761904761905, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '6812886', 'n_tokens_mistral': 356, 'n_tokens_neox': 340, 'n_words': 58}