80 lines
1.5 KiB
PHP
80 lines
1.5 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\UserGender;
|
|
use App\Enums\UserMaritalStatus;
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Foundation\Auth\User as Authenticated;
|
|
/**
|
|
* Class User
|
|
*
|
|
* @property int $id
|
|
* @property string $first_name
|
|
* @property string $last_name
|
|
* @property string $national_code
|
|
* @property bool $gender
|
|
* @property int $marital_status
|
|
* @property string|null $spouse_name
|
|
* @property int $file_id
|
|
* @property string $mobile
|
|
* @property string $email
|
|
* @property string $user_name
|
|
* @property string $password
|
|
* @property string $user_province
|
|
* @property string $user_city
|
|
* @property Carbon $created_at
|
|
* @property Carbon $updated_at
|
|
* @property string|null $deleted_at
|
|
*
|
|
* @property File $file
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class User extends Authenticated
|
|
{
|
|
use SoftDeletes;
|
|
protected $table = 'users';
|
|
|
|
protected $casts = [
|
|
'gender' => UserGender::class,
|
|
'marital_status' => UserMaritalStatus::class,
|
|
'file_id' => 'int'
|
|
];
|
|
|
|
protected $hidden = [
|
|
'password'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'first_name',
|
|
'last_name',
|
|
'national_code',
|
|
'gender',
|
|
'marital_status',
|
|
'spouse_name',
|
|
'file_id',
|
|
'mobile',
|
|
'email',
|
|
'user_name',
|
|
'password',
|
|
'user_province',
|
|
'user_city'
|
|
];
|
|
|
|
public function file()
|
|
{
|
|
return $this->belongsTo(File::class);
|
|
}
|
|
public function favorites()
|
|
{
|
|
return $this->hasMany(Favorite::class);
|
|
}
|
|
}
|