fix: update user model

This commit is contained in:
2026-08-19 08:11:50 +03:30
parent a9d46fe64c
commit c790091131
+26 -2
View File
@@ -8,7 +8,7 @@ namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Foundation\Auth\User as Authenticate;
use Illuminate\Database\Eloquent\Model;
/**
* Class User
@@ -21,22 +21,34 @@ use Illuminate\Foundation\Auth\User as Authenticate;
* @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 Authenticate
class User extends Model
{
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'
];
@@ -52,9 +64,21 @@ class User extends Authenticate
'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);