2

CodeIgniter セットアップで、Laravel の外部で Illuminate/database パッケージを使用しています。初期化はCapsule、このようなクラスを使用して行われます

use Illuminate\Database\Capsule\Manager as CapsuleManager;
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;

class Capsule extends CapsuleManager
{
public function __construct()
{
    parent::__construct();

    require_once __DIR__.'/../config/database.php';
    $db = (object) $db['default'];

    $this->addConnection(array(
        'driver'    => 'mysql',
        'host'      => $db->hostname,
        'database'  => $db->database,
        'username'  => $db->username,
        'password'  => $db->password,
        'charset'   => $db->char_set,
        'collation' => $db->dbcollat,
        'prefix'    => $db->dbprefix,
    ));

    $this->setEventDispatcher(new Dispatcher(new Container));

    // Make this Capsule instance available globally via static methods... (optional)
    $this->setAsGlobal();

    // Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
    $this->bootEloquent();
}
}

illuminate/database5.2で動かしました。最近、illuminate/database5.5にアップデートしました。Eloquent paginate() が機能しなくなりました。雄弁なコレクションの links() メソッドは、次のエラーを返します。

Call to a member function make() on null

スタックトレースで

return new HtmlString(static::viewFactory()->make($view ?: static::$defaultView, array_merge($data, [

vendor\illuminate\pagination\LengthAwarePaginator.phpライン90に

この点で何か助けていただければ幸いです。

4

0 に答える 0