方法 Illuminate\View\View::paginate 不存在。 laravel 5.8
Method Illuminate\View\View::paginate does not exist. laravel 5.8
我正在尝试获取用户状态为教师的所有结果(这是我 table 中的一个字段)。
当我尝试使用分页时,它遇到了错误。
这是我在控制器中获取结果的代码:
public function index()
{
$status = User::where('status', '=', 'teacher')->get();
return view('Profile.alluser')->with('status', $status)->paginate(3);
}
*注意laravel版本是5.8
您需要对 Query 进行分页,当您尝试对视图进行分页时,请尝试以下代码:
public function index()
{
$status = User::where('status', '=', 'teacher')->paginate(3);
return view('Profile.alluser')->with('status', $status);
}
我正在尝试获取用户状态为教师的所有结果(这是我 table 中的一个字段)。
当我尝试使用分页时,它遇到了错误。
这是我在控制器中获取结果的代码:
public function index()
{
$status = User::where('status', '=', 'teacher')->get();
return view('Profile.alluser')->with('status', $status)->paginate(3);
}
*注意laravel版本是5.8
您需要对 Query 进行分页,当您尝试对视图进行分页时,请尝试以下代码:
public function index()
{
$status = User::where('status', '=', 'teacher')->paginate(3);
return view('Profile.alluser')->with('status', $status);
}