687681744a
git commit "Implement user registration"
94 lines
1.7 KiB
PHP
94 lines
1.7 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class User
|
|
*
|
|
* @property int $id
|
|
* @property string $first_name
|
|
* @property string $last_name
|
|
* @property string $national_code
|
|
* @property int $gender
|
|
* @property int $marital_status
|
|
* @property string|null $spouse_name
|
|
* @property string $mobile
|
|
* @property string $email
|
|
* @property string|null $profile_image
|
|
* @property string $username
|
|
* @property string $password
|
|
* @property int $province_id
|
|
* @property int $city_id
|
|
* @property int $status
|
|
* @property Carbon $created_at
|
|
* @property Carbon $updated_at
|
|
*
|
|
* @property City $city
|
|
* @property Collection|Comment[] $comments
|
|
* @property Collection|Favorite[] $favorites
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class User extends Authenticatable
|
|
{
|
|
protected $table = 'users';
|
|
public static $snakeAttributes = false;
|
|
|
|
protected $casts = [
|
|
'gender' => 'int',
|
|
'marital_status' => 'int',
|
|
'province_id' => 'int',
|
|
'city_id' => 'int',
|
|
'status' => 'int'
|
|
];
|
|
|
|
protected $hidden = [
|
|
'password'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'first_name',
|
|
'last_name',
|
|
'national_code',
|
|
'gender',
|
|
'marital_status',
|
|
'spouse_name',
|
|
'mobile',
|
|
'email',
|
|
'profile_image',
|
|
'username',
|
|
'password',
|
|
'province_id',
|
|
'city_id',
|
|
'status'
|
|
];
|
|
|
|
public function city()
|
|
{
|
|
return $this->belongsTo(City::class);
|
|
}
|
|
public function province()
|
|
{
|
|
return $this->belongsTo(Province::class);
|
|
}
|
|
|
|
public function comments()
|
|
{
|
|
return $this->hasMany(Comment::class);
|
|
}
|
|
|
|
public function favorites()
|
|
{
|
|
return $this->hasMany(Favorite::class);
|
|
}
|
|
}
|