This commit is contained in:
2026-04-23 14:56:31 +07:00
parent 66de0a1da6
commit ab51c6f5d8
@@ -135,13 +135,8 @@ class ProfileController extends Controller
$user = Auth::user(); $user = Auth::user();
$profile = $user->profile; $profile = $user->profile;
dd(["User Role => ", $user->role, "Profile ID => ", $profile->id, "Requested ID => ", $id]);
if($user->role === 'petani') { $profileId = ($user->role->value === 'petani') ? $profile->id : $id;
dd(["Petani dengan profile id => ", $profile->id]);
}else{
dd(["Fasilitator dengan profile id => ", $id]);
}
$profileId = ($user->role == 'petani') ? $profile->id : $id;
$profile = Profile::with('desaKelurahan') $profile = Profile::with('desaKelurahan')
->where('id', $profileId)->firstOrFail(); ->where('id', $profileId)->firstOrFail();