<commit_before><?php namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Training_Resource;
use Request;

class Training_Resource_Controller extends Controller
{

    /**
     * Display a listing of the resource.
     *
     * @return Response
     */
    public function index()
    {
        $training_resources = Training_Resource::all();
        return $training_resources;
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @return Response
     */
    public function store()
    {

        $training_resource = Training_Resource::create(Request::all());
        return $training_resource;

    }

    /**
     * Display the specified resource.
     *
     * @param  int $id
     * @return Response
     */
    public function show($id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int $id
     * @return Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  int $id
     * @return Response
     */
    public function update($id)
    {
        // TODO: Make this working!

        $training_resource = Training_Resource::find($id);
        $training_resource->training_resource_name = Request::input('training_resource_name');
        $training_resource->training_resource_short_name = Request::input('training_resource_short_name');
        $training_resource->training_resource_description = Request::input('training_resource_description');
        $training_resource->training_resource_thumbnail = Request::input('training_resource_thumbnail');
        $training_resource->training_resource_external_url = Request::input('training_resource_external_url');
        $training_resource->training_resource_softDeleted = Request::input('training_resource_softDeleted');

        //$input = Request::all();
        /*
        $input = array_except(Input::all(), ['training_resource_last_update', 'training_resource_creationUserId',
            'training_resource_lastupdateUserId', 'training_resource_entryDate', 'training_resource_softDeletedDate',
            'training_resource_parentResourceId']);
        $training_resource->training_resource_short_name = Request::input('training_resource_short_name');
        $training_resource->training_resource_description = Request::input('training_resource_description');
        $training_resource->training_resource_thumbnail = Request::input('training_resource_thumbnail');
        $training_resource->training_resource_external_url = Request::input('training_resource_external_url');
        $training_resource->training_resource_softDeleted = Request::input('training_resource_softDeleted');*/
        $training_resource->save();

        return $training_resource;
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int $id
     * @return Response
     */
    public function destroy($id)
    {
        Training_Resource::destroy($id);
    }
}<commit_msg>Laravel 5 REST API: show working!<commit_after><?php namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Training_Resource;
use Request;

class Training_Resource_Controller extends Controller
{

    /**
     * Display a listing of the resource.
     *
     * @return Response
     */
    public function index()
    {
        $training_resources = Training_Resource::all();
        return $training_resources;
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @return Response
     */
    public function store()
    {

        $training_resource = Training_Resource::create(Request::all());
        return $training_resource;

    }

    /**
     * Display the specified resource.
     *
     * @param  int $id
     * @return Response
     */
    public function show($id)
    {

        $training_resource = Training_Resource::find($id);
        return $training_resource;

    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int $id
     * @return Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  int $id
     * @return Response
     */
    public function update($id)
    {
        // TODO: Make this working!

        $training_resource = Training_Resource::find($id);
        $training_resource->training_resource_name = Request::input('training_resource_name');
        $training_resource->training_resource_short_name = Request::input('training_resource_short_name');
        $training_resource->training_resource_description = Request::input('training_resource_description');
        $training_resource->training_resource_thumbnail = Request::input('training_resource_thumbnail');
        $training_resource->training_resource_external_url = Request::input('training_resource_external_url');
        $training_resource->training_resource_softDeleted = Request::input('training_resource_softDeleted');

        //$input = Request::all();
        /*
        $input = array_except(Input::all(), ['training_resource_last_update', 'training_resource_creationUserId',
            'training_resource_lastupdateUserId', 'training_resource_entryDate', 'training_resource_softDeletedDate',
            'training_resource_parentResourceId']);
        $training_resource->training_resource_short_name = Request::input('training_resource_short_name');
        $training_resource->training_resource_description = Request::input('training_resource_description');
        $training_resource->training_resource_thumbnail = Request::input('training_resource_thumbnail');
        $training_resource->training_resource_external_url = Request::input('training_resource_external_url');
        $training_resource->training_resource_softDeleted = Request::input('training_resource_softDeleted');*/
        $training_resource->save();

        return $training_resource;
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int $id
     * @return Response
     */
    public function destroy($id)
    {
        Training_Resource::destroy($id);
    }
}
{'fraction_non_alphanumeric': 0.10806673809888259, 'fraction_numerical': 0.00015306903413439462, 'mean_word_length': 3.023399014778325, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '6811239', 'n_tokens_mistral': 1716, 'n_tokens_neox': 1701, 'n_words': 319}