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

use App\Models\User;
use Carbon\Carbon;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Queue;
use Illuminate\Http\Request;
use Rhumsaa\Uuid\Console\Exception;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use App\Http\Validators\TestValidator;

class TestController extends BaseController
{

    public static $model = 'App\Models\TestEntity';

    /**
     * Validation service.
     *
     * @var App\Services\Validation\TestValidator
     */
    protected $validator;

    /**
     * Assign dependencies.
     *
     * @return void
     */
    public function __construct(TestValidator $validator)
    {
        $this->validator = $validator;

        parent::__construct();
    }

    public function postOne(\Illuminate\Http\Request $request)
    {
        if (!$this->validator->with($request->all())->passes()) {
            return $this->validator->errors();
        }
        return 'passed';
    }

    public function email(Request $request){

        $subject = $request->input('subject');

        $responseCode = Mail::send('emails.welcome', [], function($message) use ($subject)
        {
            $message->to('<EMAIL>', '<NAME>')->subject($subject);
        });

        $message = [
            'message' => "testing email",
            'response_code' => $responseCode,
        ];

        return response()->json($message);<commit_msg>Implements creation of test entity<commit_after><?php namespace App\Http\Controllers;

use App\Models\User;
use Carbon\Carbon;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Queue;
use Illuminate\Http\Request;
use Rhumsaa\Uuid\Console\Exception;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use App\Http\Validators\TestValidator;
use App\Repositories\TestRepository;

class TestController extends BaseController
{

    public static $model = 'App\Models\TestEntity';

    /**
     * Validation service.
     *
     * @var App\Services\Validation\TestValidator
     */
    protected $validator;

    /**
     * Assign dependencies.
     *
     * @param  TestValidator $validator
     * @param  TestRepository  $repository
     * @return void
     */
    public function __construct(TestValidator $validator, TestRepository $repository)
    {
        $this->validator = $validator;
        $this->repository = $repository;

        parent::__construct();
    }

    /**
     * Post a new entity.
     *
     * @param  Request $request
     * @return mixed
     */
    public function postOne(Request $request)
    {
        if (!$this->validator->with($request->all())->passes()) {
            return $this->validator->errors();
        }

        return parent::postOne($request);
    }

    public function email(Request $request){

        $subject = $request->input('subject');

        $responseCode = Mail::send('emails.welcome', [], function($message) use ($subject)
        {
            $message->to('<EMAIL>', '<NAME>')->subject($subject);
        });

        $message = [
            'message' => "testing email",
            'response_code' => $responseCode,
        ];

        return response()->json($message);
{'fraction_non_alphanumeric': 0.1347416500142735, 'fraction_numerical': 0.0, 'mean_word_length': 2.8675496688741724, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 34, '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': '3943244', 'n_tokens_mistral': 971, 'n_tokens_neox': 987, 'n_words': 186}