Files
shahrzadzandi09/app/Models/User.php
T
2026-08-20 08:21:55 +03:30

93 lines
1.7 KiB
PHP

<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class User
*
* @property int $id
* @property string $first_name
* @property string $last_name
* @property string $email
* @property string $mobile
* @property string $password
* @property string|null $national_code
* @property Carbon|null $birth_date
* @property bool $gender
* @property bool $marital_status
* @property string|null $spouse_name
* @property string|null $image
* @property string $username
* @property int $province_id
* @property int|null $city_id
* @property int $status
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property Collection|Booking[] $bookings
* @property Collection|Comment[] $comments
* @property Collection|Favorite[] $favorites
*
* @package App\Models
*/
class User extends Authenticatable
{
protected $table = 'users';
public static $snakeAttributes = false;
protected $casts = [
'birth_date' => 'datetime',
'gender' => 'bool',
'marital_status' => 'bool',
'province_id' => 'int',
'city_id' => 'int',
'status' => 'int'
];
protected $hidden = [
'password'
];
protected $fillable = [
'first_name',
'last_name',
'email',
'mobile',
'password',
'national_code',
'birth_date',
'gender',
'marital_status',
'spouse_name',
'image',
'username',
'province_id',
'city_id',
'status'
];
public function bookings()
{
return $this->hasMany(Booking::class);
}
public function comments()
{
return $this->hasMany(Comment::class);
}
public function favorites()
{
return $this->hasMany(Favorite::class);
}
}