profile by id
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user