Extend user model for Sentry

Submitted by Mahmoud_Zalt - 6 years ago

Using Sentry With Eloquent

It works with me as follow:

go to the sentry config file file (app/config/packages/cartalyst/sentry/config.php)
and make the user model point to the default laravel's user model

'model' => 'User',
// 'model' => 'Cartalyst\Sentry\Users\Eloquent\User',
then extend the sentry default user like this:


use Cartalyst\Sentry\Users\Eloquent\User as SentryUserModel;

class User extends SentryUserModel {

    protected $hashableAttributes = array(


in the above example I am preventing sentry from hashing the password field by overriding the $hashableAtrributes array.