I am using the Sentry2 package in my laravel 4 application ( http://docs.cartalyst.com/sentry-2/ ).
I am creating a new user model that extends the Sentry2 user model:
<?php namespace App\Models; use Illuminate\Auth\UserInterface; use Illuminate\Auth\Reminders\RemindableInterface; class User extends \Cartalyst\Sentry\Users\Eloquent\User implements UserInterface, RemindableInterface { protected $table = 'users'; protected $hidden = array('password'); public function getAuthIdentifier() { return $this->getKey(); } public function getAuthPassword() { return $this->password; } public function getReminderEmail() { return $this->email; } }
when I execute the following code, I have an exception.
$adminUser = User::create(array( 'email' => ' admin@admin.com ', 'password' => "admin", 'first_name' => 'Admin', 'last_name' => 'Admin', 'activated' => 1, ));
Mistake:
[RuntimeException] A hasher has not been provided for the user.
laravel laravel-4
Miguel borges
source share