2014-06-28 02:41:44 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Auth\Reminders\RemindableInterface;
|
2014-07-05 09:19:15 -05:00
|
|
|
use Illuminate\Auth\Reminders\RemindableTrait;
|
|
|
|
use Illuminate\Auth\UserInterface;
|
|
|
|
use Illuminate\Auth\UserTrait;
|
2014-07-15 10:09:59 -05:00
|
|
|
use LaravelBook\Ardent\Ardent;
|
2014-06-28 02:41:44 -05:00
|
|
|
|
2014-07-15 10:09:59 -05:00
|
|
|
|
2014-07-15 15:16:29 -05:00
|
|
|
/**
|
|
|
|
* User
|
|
|
|
*
|
|
|
|
* @property integer $id
|
|
|
|
* @property \Carbon\Carbon $created_at
|
|
|
|
* @property \Carbon\Carbon $updated_at
|
|
|
|
* @property string $email
|
|
|
|
* @property string $password
|
|
|
|
* @property string $reset
|
|
|
|
* @property string $remember_token
|
|
|
|
* @property boolean $migrated
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Account[] $accounts
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Preference[] $preferences
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Component[] $components
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Budget[] $budgets
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Category[] $categories
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\User whereId($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\User whereCreatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\User whereUpdatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\User whereEmail($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\User wherePassword($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\User whereReset($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\User whereRememberToken($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\User whereMigrated($value)
|
|
|
|
*/
|
2014-07-15 10:09:59 -05:00
|
|
|
class User extends Ardent implements UserInterface, RemindableInterface
|
2014-06-29 15:12:33 -05:00
|
|
|
{
|
|
|
|
|
|
|
|
use UserTrait, RemindableTrait;
|
|
|
|
|
|
|
|
|
2014-07-05 09:19:15 -05:00
|
|
|
public static $rules
|
|
|
|
= [
|
|
|
|
'email' => 'required|email|unique:users,email',
|
|
|
|
'migrated' => 'required|numeric|between:0,1',
|
|
|
|
'password' => 'required|between:60,60',
|
|
|
|
'reset' => 'between:32,32',
|
|
|
|
];
|
2014-07-09 06:19:30 -05:00
|
|
|
|
|
|
|
public static $factory
|
|
|
|
= [
|
|
|
|
'email' => 'email',
|
2014-07-15 10:09:59 -05:00
|
|
|
'password' => 'string|60',
|
2014-07-09 06:19:30 -05:00
|
|
|
'migrated' => '0'
|
|
|
|
|
|
|
|
];
|
2014-06-29 15:12:33 -05:00
|
|
|
/**
|
|
|
|
* The database table used by the model.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $table = 'users';
|
|
|
|
/**
|
|
|
|
* The attributes excluded from the model's JSON form.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
2014-07-03 02:43:12 -05:00
|
|
|
protected $hidden = array('remember_token');
|
2014-06-28 02:41:44 -05:00
|
|
|
|
2014-07-05 09:19:15 -05:00
|
|
|
public function accounts()
|
|
|
|
{
|
2014-06-30 00:26:38 -05:00
|
|
|
return $this->hasMany('Account');
|
|
|
|
}
|
|
|
|
|
2014-07-06 08:18:11 -05:00
|
|
|
public function preferences()
|
|
|
|
{
|
|
|
|
return $this->hasMany('Preference');
|
|
|
|
}
|
|
|
|
|
2014-07-15 00:08:13 -05:00
|
|
|
public function components()
|
|
|
|
{
|
|
|
|
return $this->hasMany('Component');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function budgets()
|
|
|
|
{
|
|
|
|
return $this->hasMany('Budget');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function categories()
|
|
|
|
{
|
|
|
|
return $this->hasMany('Category');
|
|
|
|
}
|
|
|
|
|
2014-07-03 02:43:12 -05:00
|
|
|
}
|