Я использую пакет Sentry2 в своем приложении laravel 4 (http://docs.cartalyst.com/sentry-2/).Расширение пользовательской модели Sentry2
создать новую модель пользователя, который расширяет Sentry2 пользователя Модель:
<?php namespace App\Models;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableInterface;
class User extends \Cartalyst\Sentry\Users\Eloquent\User implements UserInterface, RemindableInterface {
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = array('password');
/**
* Get the unique identifier for the user.
*
* @return mixed
*/
public function getAuthIdentifier()
{
return $this->getKey();
}
/**
* Get the password for the user.
*
* @return string
*/
public function getAuthPassword()
{
return $this->password;
}
/**
* Get the e-mail address where password reminders are sent.
*
* @return string
*/
public function getReminderEmail()
{
return $this->email;
}
}
, когда я выполняю код последующих У меня есть исключение.
$adminUser = User::create(array(
'email' => '[email protected]',
'password' => "admin",
'first_name' => 'Admin',
'last_name' => 'Admin',
'activated' => 1,
));
Ошибка:
[RuntimeException]
A hasher has not been provided for the user.
проблема не в этом. Hash: make, а не решить проблему. –