profile by id

This commit is contained in:
2026-04-22 14:33:30 +07:00
parent 4ad1b71683
commit 36f5a0d580
@@ -138,8 +138,8 @@ class ProfileController extends Controller
$profileId = $user->role === 'petani' ? $profile->id : $id;
$profile = Profile::with('desaKelurahan')
->when($profileId, fn($q,$v) => $q->where('id',$v))
->where('user_id', Auth::id())->first();
->when($profileId, fn($q,$v) => $q->where('id',$v))->first();
// ->where('user_id', Auth::id())->first();
return response()->json(new ProfileResource($profile));
}