119 lines
2.6 KiB
PHP
Executable File
119 lines
2.6 KiB
PHP
Executable File
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* 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 boolean $qr_code
|
|
* @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 Carbon|null $date_adhesion
|
|
* @property int|null $id_bank_country
|
|
* @property string|null $iban
|
|
*
|
|
* @property Collection|Identification[] $identifications
|
|
* @property Collection|WalletsUser[] $wallets_users
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class User extends Model
|
|
{
|
|
protected $table = 'users';
|
|
public $timestamps = false;
|
|
|
|
protected $casts = [
|
|
'solde' => 'float',
|
|
'active' => 'int',
|
|
'network_id' => 'int',
|
|
'group_id' => 'int',
|
|
'balance_credit' => 'float',
|
|
'balance_epargne' => 'float',
|
|
'id_bank_country' => 'int'
|
|
];
|
|
|
|
protected $dates = [
|
|
'expiration_date',
|
|
'date_modified',
|
|
'date_created',
|
|
'date_adhesion'
|
|
];
|
|
|
|
protected $hidden = [
|
|
'encrypted_password'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'uid',
|
|
'firstname',
|
|
'lastname',
|
|
'phone',
|
|
'email',
|
|
'user_code',
|
|
'numero_carte',
|
|
'expiration_date',
|
|
'adresse',
|
|
'solde',
|
|
'encrypted_password',
|
|
'salt',
|
|
'validation_code',
|
|
'active',
|
|
'qr_code',
|
|
'date_modified',
|
|
'date_created',
|
|
'group_id',
|
|
'balance_credit',
|
|
'balance_epargne',
|
|
'date_adhesion',
|
|
'id_bank_country',
|
|
'iban'
|
|
];
|
|
|
|
public function identifications()
|
|
{
|
|
return $this->hasMany(Identification::class, 'id_user');
|
|
}
|
|
|
|
public function wallets_users()
|
|
{
|
|
return $this->hasMany(WalletsUser::class, 'idUser');
|
|
}
|
|
|
|
public function network()
|
|
{
|
|
return $this->belongsTo(Network::class, 'network_id');
|
|
}
|
|
|
|
public function bank()
|
|
{
|
|
return $this->belongsTo(NetworksOperator::class, 'id_bank_country', 'id_operator_country');
|
|
}
|
|
}
|