Files
2026-08-22 11:15:20 +03:30

114 lines
2.2 KiB
PHP

<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticated;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Notifications\Notifiable;
/**
* 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 int|null $image_id
* @property string $username
* @property string $password
* @property int $province_id
* @property int $city_id
* @property int|null $status
* @property Carbon $created_at
* @property Carbon $updated_at
* @property string|null $deleted_at
*
* @property File|null $file
* @property City $city
* @property Province $province
* @property Collection|Booking[] $bookings
* @property Collection|Comment[] $comments
* @property Collection|Favorite[] $favorites
*
* @package App\Models
*/
class User extends Authenticated implements MustVerifyEmail{
use SoftDeletes, Notifiable;
protected $table = 'users';
public static $snakeAttributes = false;
protected $casts = [
'gender' => 'int',
'marital_status' => 'int',
'image_id' => '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',
'image_id',
'username',
'password',
'province_id',
'city_id',
'status',
'image_id',
];
public function file()
{
return $this->belongsTo(File::class, 'image_id');
}
public function city()
{
return $this->belongsTo(City::class);
}
public function province()
{
return $this->belongsTo(Province::class);
}
public function bookings()
{
return $this->hasMany(Booking::class);
}
public function comments()
{
return $this->hasMany(Comment::class);
}
public function favorites()
{
return $this->hasMany(Favorite::class);
}
}