nanosanteservice/app/Models/User.php

120 lines
2.9 KiB
PHP
Raw Normal View History

2021-10-04 16:24:39 +00:00
<?php
namespace App\Models;
use Carbon\Carbon;
2021-10-04 16:24:39 +00:00
use Illuminate\Auth\Authenticatable;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Database\Eloquent\Collection;
2021-10-04 16:24:39 +00:00
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Laravel\Lumen\Auth\Authorizable;
/**
* Class User
*
* @property int $id
* @property string $uid
* @property string $firstname
* @property string $lastname
* @property string $phone
* @property string $email
* @property string $user_code
* @property string $numero_carte
* @property Carbon $expiration_date
* @property string $adresse
* @property float $solde
* @property string $encrypted_password
* @property string $salt
* @property string $validation_code
* @property int $active
* @property Carbon $date_modified
* @property Carbon $date_created
* @property int $network_id
* @property int $group_id
* @property float $balance_credit
* @property float $balance_epargne
* @property float $balance_nano_health
* @property Carbon|null $date_adhesion
* @property int|null $id_bank_country
* @property string|null $iban
*
* @package App\Models
*/
2021-10-04 16:24:39 +00:00
class User extends Model implements AuthenticatableContract, AuthorizableContract
{
use Authenticatable, Authorizable, HasFactory;
protected $table = 'users';
public $timestamps = false;
protected $casts = [
'solde' => 'float',
'active' => 'int',
'network_id' => 'int',
'group_id' => 'int',
'balance_credit' => 'float',
'balance_epargne' => 'float',
'balance_nano_health' => 'float',
'id_bank_country' => 'int'
];
protected $dates = [
'expiration_date',
'date_modified',
'date_created',
'date_adhesion'
];
2021-10-04 16:24:39 +00:00
/**
* The attributes excluded from the model's JSON form.
2021-10-04 16:24:39 +00:00
*
* @var array
*/
protected $hidden = [
'encrypted_password'
2021-10-04 16:24:39 +00:00
];
/**
* The attributes that are mass assignable.
2021-10-04 16:24:39 +00:00
*
* @var array
*/
protected $fillable = [
'uid',
'firstname',
'lastname',
'phone',
'email',
'user_code',
'numero_carte',
'expiration_date',
'adresse',
'solde',
'encrypted_password',
'salt',
'validation_code',
'active',
'date_modified',
'date_created',
'group_id',
'balance_credit',
'balance_epargne',
'balance_nano_health' => 'float',
'date_adhesion',
'id_bank_country',
'iban'
2021-10-04 16:24:39 +00:00
];
2021-10-28 12:13:50 +00:00
public function identification()
{
return $this->hasOne(Identification::class, 'id_user');
}
public function network()
{
return $this->belongsTo(Network::class, 'network_id');
}
2021-10-04 16:24:39 +00:00
}