Skip to content

Instantly share code, notes, and snippets.

@ziyahan
Created March 4, 2015 13:16
Show Gist options
  • Save ziyahan/ad3425172269013b6d0c to your computer and use it in GitHub Desktop.
Save ziyahan/ad3425172269013b6d0c to your computer and use it in GitHub Desktop.
User
<?php namespace App\DBModel;
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract {
use Authenticatable, CanResetPassword;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['name', 'email', 'password'];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = ['password', 'remember_token'];
public function role()
{
return $this->belongsTo('App\DBModel\Role');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment