xxxxxxxxxx
$category = Category::first();
$apps = $category->apps()->paginate(10);
return view('example', compact('category', 'apps'));
xxxxxxxxxx
@foreach ($apps as $app)
{{ $app->id }}
@endforeach
{!! $apps->render() !!}
xxxxxxxxxx
$category = Category::where('slug', $slug)->first();
$category->setRelation('lessons', $category->lesson()->paginate(10));
xxxxxxxxxx
$consumptions = $this->meter->consumption_generators()
->orderBy($this->sort, $this->direction)
->paginate($this->cant);