profile by id
This commit is contained in:
@@ -138,8 +138,8 @@ class ProfileController extends Controller
|
|||||||
$profileId = $user->role === 'petani' ? $profile->id : $id;
|
$profileId = $user->role === 'petani' ? $profile->id : $id;
|
||||||
|
|
||||||
$profile = Profile::with('desaKelurahan')
|
$profile = Profile::with('desaKelurahan')
|
||||||
->when($profileId, fn($q,$v) => $q->where('id',$v))
|
->when($profileId, fn($q,$v) => $q->where('id',$v))->first();
|
||||||
->where('user_id', Auth::id())->first();
|
// ->where('user_id', Auth::id())->first();
|
||||||
return response()->json(new ProfileResource($profile));
|
return response()->json(new ProfileResource($profile));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user