Undefined property: Illuminate\Pagination\LengthAwarePaginator::Is there a way to replace it?

Posted 1 year ago by irankhosravi

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?

Please sign in or create an account to participate in this conversation.