2FAuth/app/Api/v1/Controllers/UserController.php
2022-03-31 11:24:01 +02:00

26 lines
531 B
PHP

<?php
namespace App\Api\v1\Controllers;
use App\Models\User;
use App\Api\v1\Requests\UserUpdateRequest;
use App\Api\v1\Resources\UserResource;
use App\Http\Controllers\Controller;
class UserController extends Controller
{
/**
* Get detailed information about a user
*
* @return \App\Api\v1\Resources\UserResource
*/
public function show()
{
$user = User::first();
return $user
? new UserResource($user)
: response()->json(['name' => null], 200);
}
}