LongAwarePaginator.php中的Laravel 5 ErrorException

I'm creating my own custom pagination manually in Laravel 5 using Illuminate\Pagination\Paginator and Illuminate\Pagination\LengthAwarePaginator. It is working perfectly fine not until I added a constructor on my controller. Even just a blank constructor will return an error.

use App\Controllers\CoreController;
use Illuminate\Pagination\Paginator;
use Illuminate\Pagination\LengthAwarePaginator;

class CodeTables extends CoreController {

    public function __construct()
    {
       // nothing here, just blank
    }

    public function index()
    {
        $pagination = new LengthAwarePaginator($contents, $totalRows, $rowsPerPage, Paginator::resolveCurrentPage(), array('path' => Paginator::resolveCurrentPath()));
    }

}

When I have that constructor, it gives me an error of: ErrorException in LengthAwarePaginator.php line 47: Division by zero

But removing the constructor method works perfectly fine.

If you are sure that everything is working when you don't have constructor defined in your CodeTables class, you should call parent constructor in your constructor:

public function __construct()
{
   // nothing here, just blank
  parent::__construct();
}