Created
May 2, 2024 17:37
-
-
Save raksit31667/195bde659ea11d73689227875d0307ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Models\User; | |
use Illuminate\Http\JsonResponse; | |
class UserController extends Controller | |
{ | |
function show(string $username): JsonResponse | |
{ | |
$user = User::findByName($username); | |
return response()->json($user); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment