1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 17:01:33 +02:00
invoiceninja/app/Models/User.php
David Bomba 103a95955a
Sign up (#2460)
* Privacy Policy & TOS

* configure additional dependency packages for redis and modules, middleware implementation for multi-db

* Stub the signup
2018-10-19 14:45:55 +11:00

68 lines
1.3 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
use SoftDeletes;
protected $guard = 'user';
protected $dates = ['deleted_at'];
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'first_name',
'last_name',
'email',
'phone',
'signature',
'avatar',
'accepted_terms_version'
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'remember_token',
'confirmation_code',
'oauth_user_id',
'oauth_provider_id',
'google_2fa_secret',
'google_2fa_phone',
'remember_2fa_token',
'slack_webhook_url',
];
public function user_accounts()
{
return $this->hasMany(UserAccount::class);
}
public function contacts()
{
return $this->hasMany(Contact::class);
}
public function owns($entity)
{
return ! empty($entity->user_id) && $entity->user_id == $this->id;
}
}