Use function to call paginator

This commit is contained in:
DariusIII
2018-05-12 22:59:36 +02:00
parent e551a3b901
commit 3beb5f514e
9 changed files with 24 additions and 9 deletions
@@ -13,6 +13,7 @@ use App\Models\Settings;
use Blacklight\Contents;
use App\Models\Forumpost;
use App\Models\RoleExcludedCategory;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Facades\Auth;
class BasePageController extends Controller
@@ -92,6 +93,19 @@ class BasePageController extends Controller
$this->smarty->assign('serverroot', url('/'));
}
/**
* @param $query
* @param $totalcount
* @param $items
* @param $page
* @param $path
* @return \Illuminate\Pagination\LengthAwarePaginator
*/
public function paginate($query, $totalcount, $items, $page, $path)
{
return new LengthAwarePaginator($query, $totalcount, $items, $page, ['path' => $path]);
}
/**
* @throws \Exception
*/