firefly-iii/app/models/User.php

69 lines
1.4 KiB
PHP
Raw Normal View History

2014-06-28 02:41:44 -05:00
<?php
use Illuminate\Auth\Reminders\RemindableInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\UserTrait;
use LaravelBook\Ardent\Ardent;
2014-06-28 02:41:44 -05:00
class User extends Ardent implements UserInterface, RemindableInterface
{
use UserTrait, RemindableTrait;
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',
'password' => 'string|60',
2014-07-09 06:19:30 -05:00
'migrated' => '0'
];
/**
* 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
public function accounts()
{
return $this->hasMany('Account');
}
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
}