2015-02-05 22:35:00 -06:00
|
|
|
<?php namespace FireflyIII;
|
2015-02-05 21:39:52 -06:00
|
|
|
|
|
|
|
use Illuminate\Auth\Authenticatable;
|
|
|
|
use Illuminate\Auth\Passwords\CanResetPassword;
|
|
|
|
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
|
|
|
|
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
|
2015-02-05 22:04:06 -06:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2015-05-27 23:43:07 -05:00
|
|
|
use Zizaco\Entrust\Traits\EntrustUserTrait;
|
2015-02-05 21:39:52 -06:00
|
|
|
|
2015-02-11 00:35:10 -06:00
|
|
|
/**
|
|
|
|
* Class User
|
2015-06-27 01:06:24 -05:00
|
|
|
*
|
2015-02-11 00:35:10 -06:00
|
|
|
* @package FireflyIII
|
2015-07-15 14:06:26 -05:00
|
|
|
* @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-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Account[] $accounts
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Tag[] $tags
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Bill[] $bills
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Budget[] $budgets
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Category[] $categories
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Preference[] $preferences
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Config::get('entrust.role[] $roles
|
2015-07-09 14:29:30 -05:00
|
|
|
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereId($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereCreatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereUpdatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereEmail($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\User wherePassword($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereReset($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereRememberToken($value)
|
2015-02-11 00:35:10 -06:00
|
|
|
*/
|
2015-02-05 22:04:06 -06:00
|
|
|
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
|
|
|
|
{
|
|
|
|
|
2015-05-27 23:43:07 -05:00
|
|
|
use Authenticatable, CanResetPassword, EntrustUserTrait;
|
2015-02-05 22:04:06 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The attributes that are mass assignable.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
2015-02-07 06:15:40 -06:00
|
|
|
protected $fillable = ['email', 'password'];
|
2015-02-05 22:04:06 -06:00
|
|
|
/**
|
|
|
|
* The attributes excluded from the model's JSON form.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $hidden = ['password', 'remember_token'];
|
2015-02-05 22:14:27 -06:00
|
|
|
/**
|
|
|
|
* The database table used by the model.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $table = 'users';
|
2015-02-05 22:04:06 -06:00
|
|
|
|
2015-02-11 00:35:10 -06:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
*/
|
2015-02-05 22:04:06 -06:00
|
|
|
public function accounts()
|
|
|
|
{
|
2015-02-05 22:35:00 -06:00
|
|
|
return $this->hasMany('FireflyIII\Models\Account');
|
2015-02-05 22:04:06 -06:00
|
|
|
}
|
2015-02-05 22:01:24 -06:00
|
|
|
|
2015-04-28 01:58:01 -05:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
*/
|
|
|
|
public function tags()
|
|
|
|
{
|
|
|
|
return $this->hasMany('FireflyIII\Models\Tag');
|
|
|
|
}
|
|
|
|
|
2015-02-11 00:35:10 -06:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
*/
|
2015-02-05 22:14:27 -06:00
|
|
|
public function bills()
|
|
|
|
{
|
2015-02-05 22:35:00 -06:00
|
|
|
return $this->hasMany('FireflyIII\Models\Bill');
|
2015-02-05 22:14:27 -06:00
|
|
|
}
|
|
|
|
|
2015-02-11 00:35:10 -06:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
*/
|
2015-02-05 22:14:27 -06:00
|
|
|
public function budgets()
|
|
|
|
{
|
2015-02-05 22:35:00 -06:00
|
|
|
return $this->hasMany('FireflyIII\Models\Budget');
|
2015-02-05 22:14:27 -06:00
|
|
|
}
|
|
|
|
|
2015-02-11 00:35:10 -06:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
*/
|
2015-02-05 22:14:27 -06:00
|
|
|
public function categories()
|
|
|
|
{
|
2015-02-05 22:35:00 -06:00
|
|
|
return $this->hasMany('FireflyIII\Models\Category');
|
2015-02-05 22:14:27 -06:00
|
|
|
}
|
|
|
|
|
2015-02-11 00:35:10 -06:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
|
|
|
*/
|
2015-02-05 22:14:27 -06:00
|
|
|
public function piggyBanks()
|
|
|
|
{
|
2015-02-24 14:10:25 -06:00
|
|
|
return $this->hasManyThrough('FireflyIII\Models\PiggyBank', 'FireflyIII\Models\Account');
|
2015-02-05 22:14:27 -06:00
|
|
|
}
|
|
|
|
|
2015-03-29 11:28:49 -05:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
|
|
|
*/
|
|
|
|
public function transactions()
|
|
|
|
{
|
|
|
|
return $this->hasManyThrough('FireflyIII\Models\Transaction', 'FireflyIII\Models\TransactionJournal');
|
|
|
|
}
|
|
|
|
|
2015-02-11 00:35:10 -06:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
*/
|
2015-02-05 22:14:27 -06:00
|
|
|
public function preferences()
|
|
|
|
{
|
2015-02-05 22:35:00 -06:00
|
|
|
return $this->hasMany('FireflyIII\Models\Preference');
|
2015-02-05 22:14:27 -06:00
|
|
|
}
|
|
|
|
|
2015-02-11 00:35:10 -06:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
*/
|
2015-02-05 22:14:27 -06:00
|
|
|
public function transactionjournals()
|
|
|
|
{
|
2015-02-05 22:35:00 -06:00
|
|
|
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
2015-02-05 22:14:27 -06:00
|
|
|
}
|
|
|
|
|
2015-02-05 21:39:52 -06:00
|
|
|
}
|