2015-07-02 2 views
0

Можно ли использовать Cartalyst/Sentinel с Jenssegers/MongoDB на Laravel 4.2? Я использую Sentry, но я хочу попробовать Sentinel с новыми функциями.Laravel 4.2 использовать Sentinel с Jenssegers MongoDB

После установки, я попытался это:

$user = Sentinel::register([ 
     'email'    => $email, 
     'password'   => $password, 
    ]); 

Но я получаю следующее сообщение об ошибке:

Argument 2 passed to Illuminate\Database\Query\Builder::__construct() must be an instance of Illuminate\Database\Query\Grammars\Grammar, null given, called in /home/vagrant/shared/muzza/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php on line 1853 and defined

ответ

-1

Страж не имеет интеграцию с Jenssegers MongoDB Lib.

Dan Syme commented on 2 Jul:

You would have to write the implementations for the different models used throughout Sentinel.

Then switch out the models for the different entities on the config file with your own implementations, Sentinel should take care of everything else.

Maxime-BHA commented on 3 Jul:

As @jenssegers already did for Sentry package, you have to create your own Models extending the originals models from Sentinel and bind the attributes defined in those models for relationships/persistances to the new models etc.. like static $usersModel = 'Cartalyst\Sentinel\Users\EloquentUser'; and also change the config file.

See exemple for Sentry there : https://github.com/jenssegers/laravel-mongodb-sentry

I think it's the exact same procedure.

Дополнительную информацию вы найдете here.

Смежные вопросы