<commit_before><?php

namespace App\Http\Controllers;

use App\Topic;
use App\Reply;

use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use App\Http\Requests;

class TopicController extends Controller
{
	public function show(Topic $topic) {
        $replies = Reply::where('topic_id', $topic->id)->orderBy('created_at', 'desc')->paginate('10');
		return view('topic.show', ['topic' => $topic, 'replies' => $replies]);
	}

    public function new() {
    	return view('topic.new');
    }

    public function create(Request $request) {
    	$this->validateRequest($request);

    	$user = Auth::user();
    	$topic = new Topic;
    	$topic->title = $request->title;
    	$topic->content = $request->content;
    	$topic->user_id = $user->id;
    	$topic->save();

    	\Session::flash('success', 'Your topic has been successfully created!');
    	return redirect()->route('topic', ['topic' => $topic]);
    }
<commit_msg>Fixed replies to be in ascending order<commit_after><?php

namespace App\Http\Controllers;

use App\Topic;
use App\Reply;

use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use App\Http\Requests;

class TopicController extends Controller
{
	public function show(Topic $topic) {
        $replies = Reply::where('topic_id', $topic->id)->orderBy('created_at', 'asc')->paginate('10');
		return view('topic.show', ['topic' => $topic, 'replies' => $replies]);
	}

    public function new() {
    	return view('topic.new');
    }

    public function create(Request $request) {
    	$this->validateRequest($request);

    	$user = Auth::user();
    	$topic = new Topic;
    	$topic->title = $request->title;
    	$topic->content = $request->content;
    	$topic->user_id = $user->id;
    	$topic->save();

    	\Session::flash('success', 'Your topic has been successfully created!');
    	return redirect()->route('topic', ['topic' => $topic]);
    }

{'fraction_non_alphanumeric': 0.17616033755274263, 'fraction_numerical': 0.002109704641350211, 'mean_word_length': 3.8516624040920715, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '5311655', 'n_tokens_mistral': 611, 'n_tokens_neox': 614, 'n_words': 134}