<commit_before><?php

namespace TypiCMS\Modules\Objects\Http\Controllers;

use Illuminate\View\View;
use TypiCMS\Modules\Core\Http\Controllers\BasePublicController;
use TypiCMS\Modules\Objects\Models\Object;

class PublicController extends BasePublicController
{
    public function index(): View
    {
        $models = Object::published()->with('image')->get();

        return view('objects::public.index')
            ->with(compact('models'));
    }

    public function show($slug): View
    {
        $model = Object::published()->whereSlugIs($slug)->firstOrFail();

        return view('objects::public.show')
            ->with(compact('model'));
    }
}<commit_msg>Update PublicController.php<commit_after><?php

namespace TypiCMS\Modules\Objects\Http\Controllers;

use Illuminate\View\View;
use TypiCMS\Modules\Core\Http\Controllers\BasePublicController;
use TypiCMS\Modules\Objects\Models\Object;

class PublicController extends BasePublicController
{
    public function index(): View
    {
        $models = Object::published()->order()->with('image')->get();

        return view('objects::public.index')
            ->with(compact('models'));
    }

    public function show($slug): View
    {
        $model = Object::published()->whereSlugIs($slug)->firstOrFail();

        return view('objects::public.show')
            ->with(compact('model'));
    }
}
{'fraction_non_alphanumeric': 0.15222141296431171, 'fraction_numerical': 0.0, 'mean_word_length': 3.610738255033557, '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': '2966830', 'n_tokens_mistral': 389, 'n_tokens_neox': 391, 'n_words': 63}