<commit_before><?php

namespace Zeropingheroes\Lanager\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Zeropingheroes\Lanager\Requests\StoreRoleAssignmentRequest;
use Zeropingheroes\Lanager\Role;
use Zeropingheroes\Lanager\RoleAssignment;
use Zeropingheroes\Lanager\User;
use Illuminate\Support\Facades\View;

class RoleAssignmentController extends Controller
{

    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        return View::make('pages.role-assignment.index')
            ->with('roleAssignments', RoleAssignment::all())
            ->with('users', User::all()->pluck('username', 'id'))
            ->with('roles', Role::all()->pluck('name', 'id'));
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param Request $httpRequest
     * @return \Illuminate\Http\Response
     * @internal param Request|StoreRoleAssignmentRequest $request
     */
    public function store(Request $httpRequest)
    {
        $this->authorize('create', RoleAssignment::class);

        // TODO: Store assigned_by
        $input = $httpRequest->only(['user_id', 'role_id']);


        $request = new StoreRoleAssignmentRequest($input);

        if ($request->invalid()) {
            return redirect()
                ->back()
                ->withErrors($request->errors())
                ->withInput();
        }
        $input['assigned_by'] = Auth::user()->id;

        RoleAssignment::create($input);

        return redirect()
            ->route('role-assignments.index')
            ->with('alerts', [
                [
                    'message' => __('phrase.role-successfully-assigned'),
                    'type' => 'success'
                ]
            ]);
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  \Zeropingheroes\Lanager\RoleAssignment $roleAssignment
     * @return \Illuminate\Http\Response
     */
    public function destroy(RoleAssignment $roleAssignment)
    {
        //
    }
}
<commit_msg>Removing completed todo comment<commit_after><?php

namespace Zeropingheroes\Lanager\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Zeropingheroes\Lanager\Requests\StoreRoleAssignmentRequest;
use Zeropingheroes\Lanager\Role;
use Zeropingheroes\Lanager\RoleAssignment;
use Zeropingheroes\Lanager\User;
use Illuminate\Support\Facades\View;

class RoleAssignmentController extends Controller
{

    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        return View::make('pages.role-assignment.index')
            ->with('roleAssignments', RoleAssignment::all())
            ->with('users', User::all()->pluck('username', 'id'))
            ->with('roles', Role::all()->pluck('name', 'id'));
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param Request $httpRequest
     * @return \Illuminate\Http\Response
     * @internal param Request|StoreRoleAssignmentRequest $request
     */
    public function store(Request $httpRequest)
    {
        $this->authorize('create', RoleAssignment::class);

        $input = $httpRequest->only(['user_id', 'role_id']);

        $request = new StoreRoleAssignmentRequest($input);

        if ($request->invalid()) {
            return redirect()
                ->back()
                ->withErrors($request->errors())
                ->withInput();
        }
        $input['assigned_by'] = Auth::user()->id;

        RoleAssignment::create($input);

        return redirect()
            ->route('role-assignments.index')
            ->with('alerts', [
                [
                    'message' => __('phrase.role-successfully-assigned'),
                    'type' => 'success'
                ]
            ]);
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  \Zeropingheroes\Lanager\RoleAssignment $roleAssignment
     * @return \Illuminate\Http\Response
     */
    public function destroy(RoleAssignment $roleAssignment)
    {
        //
    }
}

{'fraction_non_alphanumeric': 0.13550071191267204, 'fraction_numerical': 0.0, 'mean_word_length': 2.3162863886703384, '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': '819190', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1191, 'n_words': 212}