s
This commit is contained in:
@@ -21,8 +21,8 @@ class PanenController extends Controller
|
||||
$user = Auth::user();
|
||||
$profile = $user->profile;
|
||||
|
||||
$profileId = $user->role === 'petani' ? $profile->id : $user->id;
|
||||
$listPanen = Panen::when($profileId, fn($q,$v) => $q->where('farmer_id',$v))->get();
|
||||
$profileId = $user->role === 'petani' ? $profile->id : $request->id;
|
||||
$listPanen = Panen::when($profileId, fn($q,$v) => $q->where('farmer_id',$user->id))->get();
|
||||
|
||||
return response()->json($listPanen);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user