revisi:4
This commit is contained in:
parent
d20a3fccb0
commit
6f15751421
|
@ -17,9 +17,9 @@ class ComplaintController extends Controller
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
if (Auth::user()->role === 'admin') {
|
if (Auth::user()->role === 'admin') {
|
||||||
$complaints = Complaint::paginate(10);
|
$complaints = Complaint::latest()->get();
|
||||||
} else {
|
} else {
|
||||||
$complaints = Complaint::where('user_id', Auth::id())->latest()->paginate(10);
|
$complaints = Complaint::where('user_id', Auth::id())->latest()->get();
|
||||||
}
|
}
|
||||||
return view('complaints.index', compact('complaints'));
|
return view('complaints.index', compact('complaints'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,9 @@ class SatisfactionController extends Controller
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
if (Auth::user()->role === 'admin') {
|
if (Auth::user()->role === 'admin') {
|
||||||
$satisfactions = Satisfaction::latest()->paginate(10);
|
$satisfactions = Satisfaction::latest()->get();
|
||||||
} else {
|
} else {
|
||||||
$satisfactions = Satisfaction::where('user_id', Auth::id())->latest()->paginate(10);
|
$satisfactions = Satisfaction::where('user_id', Auth::id())->latest()->get();
|
||||||
}
|
}
|
||||||
return view('satisfactions.index', compact('satisfactions'));
|
return view('satisfactions.index', compact('satisfactions'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,10 +74,10 @@ public function index(Request $request)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Auth::user()->role === 'admin') {
|
if (Auth::user()->role === 'admin') {
|
||||||
$services = $query->latest()->paginate(10);
|
$services = $query->latest()->get();
|
||||||
} else {
|
} else {
|
||||||
$query->where('user_id', Auth::id());
|
$query->where('user_id', Auth::id());
|
||||||
$services = $query->latest()->paginate(10);
|
$services = $query->latest()->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simpan parameter filter dalam url pagination
|
// Simpan parameter filter dalam url pagination
|
||||||
|
|
Loading…
Reference in New Issue