<commit_before><?php
namespace domain\api\v1\controllers;

use Chrisbjr\ApiGuard\ApiGuardController;
use domain\api\v1\transformers\UserTransformer;
use domain\delivery\User\UserRepository;

class UserApiController extends ApiGuardController
{

    protected $apiMethods = [
        'all' => [
            'keyAuthentication' => true,
            'level' => 1,
            'limits' => [
                // The variable below sets API key limits
                'key' => [
                    'increment' => '1 hour',
                    'limit' => 100
                ],
                // The variable below sets API method limits
                'method' => [
                    'increment' => '1 day',
                    'limit' => 1000
                ]
            ]
        ],

        'showId' => [
            'keyAuthentication' => true,
            'level' => 1,
            'limits' => [
                // The variable below sets API key limits
                'key' => [
                    'increment' => '1 hour',
                    'limit' => 100
                ],
                // The variable below sets API method limits
                'method' => [
                    'increment' => '1 day',
                    'limit' => 1000
                ]
            ]
        ]
    ];

    protected $userRepo;

    function __construct(UserRepository $userRepo)
    {
        $this->userRepo = $userRepo;
    }

    public function all()
    {
        return $this->response->withCollection($this->userRepo->all(), new UserTransformer);
    }

    public function showId($id)
    {

    }

    public function login()
    {
        $data = \Input::all();
        $rules = [
            'email' => 'required|email',
            'password' => '<PASSWORD>'
        ];

        $validator = \Validator::make($data, $rules);

        if ($validator->passes()) {
            if (\Auth::attempt($data)) {
                return $this->response->withCollection(\Auth::user(), new UserTransformer);
            }
        } else {
            return $validator->errors();
        }
    }
}<commit_msg>acabando la api rest<commit_after><?php
namespace domain\api\v1\controllers;

use Chrisbjr\ApiGuard\ApiGuardController;
use domain\api\v1\transformers\UserTransformer;
use domain\delivery\User\UserRepository;

class UserApiController extends ApiGuardController
{

    protected $apiMethods = [
        'all' => [
            'keyAuthentication' => true,
            'level' => 1,
            'limits' => [
                // The variable below sets API key limits
                'key' => [
                    'increment' => '1 hour',
                    'limit' => 100
                ],
                // The variable below sets API method limits
                'method' => [
                    'increment' => '1 day',
                    'limit' => 1000
                ]
            ]
        ],

        'showId' => [
            'keyAuthentication' => true,
            'level' => 1,
            'limits' => [
                // The variable below sets API key limits
                'key' => [
                    'increment' => '1 hour',
                    'limit' => 100
                ],
                // The variable below sets API method limits
                'method' => [
                    'increment' => '1 day',
                    'limit' => 1000
                ]
            ]
        ]
    ];

    protected $userRepo;

    function __construct(UserRepository $userRepo)
    {
        $this->userRepo = $userRepo;
    }

    public function all()
    {
        return $this->response->withCollection($this->userRepo->all(), new UserTransformer);
    }

    public function showId($id)
    {

    }

    public function login()
    {
        $data = \Input::all();
        $rules = [
            'email' => 'required|email',
            'password' => '<PASSWORD>'
        ];

        $validator = \Validator::make($data, $rules);

        if ($validator->passes()) {
            if (\Auth::attempt($data)) {
                return $this->response->withItem(\Auth::user(), new UserTransformer);
            }
        } else {
            return $validator->errors();
        }
    }
}
{'fraction_non_alphanumeric': 0.1297041420118343, 'fraction_numerical': 0.010414201183431953, 'mean_word_length': 1.294245385450597, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 67, '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': '2135694', 'n_tokens_mistral': 1162, 'n_tokens_neox': 1082, 'n_words': 243}