95 lines
1.9 KiB
PHP
Executable File
95 lines
1.9 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 Carbon $date_modified
|
|
* @property Carbon $date_created
|
|
* @property int $network_id
|
|
*
|
|
* @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'
|
|
];
|
|
|
|
protected $dates = [
|
|
'expiration_date',
|
|
'date_modified',
|
|
'date_created'
|
|
];
|
|
|
|
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',
|
|
'date_modified',
|
|
'date_created'
|
|
];
|
|
|
|
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');
|
|
}
|
|
}
|