<commit_before><?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Post;

class PostsController extends Controller
{
    /**
    * Show the application posts index.
    *
    * @return \Illuminate\Http\Response
    */
    public function index()
    {
        $posts = Post::orderBy('posted_at', 'desc')->paginate(50);

        return view('admin.posts.index')->withPosts($posts);
    }
}<commit_msg>Adding edit method in Admin\PostsController<commit_after><?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Post;
use App\User;

class PostsController extends Controller
{
    /**
    * Show the application posts index.
    *
    * @return \Illuminate\Http\Response
    */
    public function index()
    {
        $posts = Post::orderBy('posted_at', 'desc')->paginate(50);

        return view('admin.posts.index')->withPosts($posts);
    }

    /**
    * Display the specified resource edit form.
    */
    public function edit(Post $post)
    {
        $users = User::pluck('name', 'id');
        return view('admin.posts.edit')->withPost($post)->withUsers($users);
    }
}
{'fraction_non_alphanumeric': 0.1453287197231834, 'fraction_numerical': 0.0034602076124567475, 'mean_word_length': 3.0454545454545454, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1780861', 'n_tokens_mistral': 353, 'n_tokens_neox': 348, 'n_words': 73}