getherbert / herbert

The WordPress Plugin Framework:
http://getherbert.com/
632 stars 94 forks source link

Paginator class not found #104

Closed giwrgos88 closed 8 years ago

giwrgos88 commented 8 years ago

From your documentation you are using Laravel components like the Illuminate. On laravel there is a function called pagination where you can use it on your model to paginate your queries. Inside the "vendor/illuminate/database/Eloquent/Builder.php" of your framework the pagination option is available as well you including it on the top of the Builder class

<?php

namespace Illuminate\Database\Eloquent;

use Closure;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Pagination\Paginator;
use Illuminate\Database\Query\Expression;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder as QueryBuilder;

class Builder
{}

but you haven't added it into the Illuminate folder,

screen shot 2016-04-04 at 10 42 08

When I run the pagination on my model I'm getting the following error message

Fatal error: Class 'Illuminate\Pagination\Paginator' not found in /Applications/XAMPP/xamppfiles/htdocs/testing/wp-content/plugins/testing/vendor/illuminate/database/Eloquent/Builder.php on line 463

Can you add it on your next release?

Thank you

ConnorVG commented 8 years ago

You could include it yourself if you wish to use it, I imagine it's not included by default because it's quite a few extra classes that most people won't use.

composer require illuminate/pagination "~5.0" will pull this in for you.

giwrgos88 commented 8 years ago

@ConnorVG ok thanks a lot