megahunt.test/app/Http/Controllers/PrivateUserController.php

26 lines
536 B
PHP

<?php
namespace App\Http\Controllers;
use App\Http\Requests\AuthorizedRequest;
use App\Services\UserService;
use Illuminate\Http\Request;
use Validator;
class PrivateUserController extends Controller
{
public function __construct(
private UserService $userService
) { }
public function list(AuthorizedRequest $request)
{
return $this->userService->listAll();
}
public function get(AuthorizedRequest $request, string $id)
{
return $this->userService->getOneById($id);
}
}