Where are you assigning user_id, I see no request or parameter even being passed?
May 20, 2018
5
Level 6
Undefined property: Illuminate\Pagination\LengthAwarePaginator::Is there a way to replace it?
What is this error?
Undefined property: Illuminate\Pagination\LengthAwarePaginator::$user_id
ArticleController.php
public function index()
{
$schools_lists = SchoolsList::latest()->paginate(25);
if(Auth::user()->id == $schools_lists->user_id){
return view('Admin.submit-information.all', compact('schools_lists'));
}
}
Is there a way to replace $user_id?
Level 15
Can you give me the code sample?
public function index()
{
$schools_lists = SchoolsList::where('user_id', Auth::user()->id)->latest()->paginate(25);
return view('Admin.submit-information.all', compact('schools_lists '));
}
1 like
Please or to participate in this conversation.