Skip to content

Instantly share code, notes, and snippets.

@felnne
Created November 25, 2014 10:16
Show Gist options
  • Save felnne/d693b5be76e5fea34bfa to your computer and use it in GitHub Desktop.
Save felnne/d693b5be76e5fea34bfa to your computer and use it in GitHub Desktop.
seeding problem - user model
<?php
use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
class User extends Eloquent implements UserInterface, RemindableInterface {
use UserTrait, RemindableTrait;
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = array('password', 'remember_token');
/**
* To protect against mass assignment attacks white-list some variables
*
* @var array
*/
protected $fillable = array('username', 'email', 'password');
public function setPasswordAttribute($password)
{
$this->attributes['password'] = Hash::make($password);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment