fix: update user model
This commit is contained in:
+26
-2
@@ -8,7 +8,7 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticate;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class User
|
* Class User
|
||||||
@@ -21,22 +21,34 @@ use Illuminate\Foundation\Auth\User as Authenticate;
|
|||||||
* @property string $password
|
* @property string $password
|
||||||
* @property string|null $national_code
|
* @property string|null $national_code
|
||||||
* @property Carbon|null $birth_date
|
* @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 int $status
|
||||||
* @property Carbon $created_at
|
* @property Carbon $created_at
|
||||||
* @property Carbon $updated_at
|
* @property Carbon $updated_at
|
||||||
*
|
*
|
||||||
|
* @property Collection|Booking[] $bookings
|
||||||
* @property Collection|Comment[] $comments
|
* @property Collection|Comment[] $comments
|
||||||
* @property Collection|Favorite[] $favorites
|
* @property Collection|Favorite[] $favorites
|
||||||
*
|
*
|
||||||
* @package App\Models
|
* @package App\Models
|
||||||
*/
|
*/
|
||||||
class User extends Authenticate
|
class User extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'users';
|
protected $table = 'users';
|
||||||
public static $snakeAttributes = false;
|
public static $snakeAttributes = false;
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'birth_date' => 'datetime',
|
'birth_date' => 'datetime',
|
||||||
|
'gender' => 'bool',
|
||||||
|
'marital_status' => 'bool',
|
||||||
|
'province_id' => 'int',
|
||||||
|
'city_id' => 'int',
|
||||||
'status' => 'int'
|
'status' => 'int'
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -52,9 +64,21 @@ class User extends Authenticate
|
|||||||
'password',
|
'password',
|
||||||
'national_code',
|
'national_code',
|
||||||
'birth_date',
|
'birth_date',
|
||||||
|
'gender',
|
||||||
|
'marital_status',
|
||||||
|
'spouse_name',
|
||||||
|
'image',
|
||||||
|
'username',
|
||||||
|
'province_id',
|
||||||
|
'city_id',
|
||||||
'status'
|
'status'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function bookings()
|
||||||
|
{
|
||||||
|
return $this->hasMany(Booking::class);
|
||||||
|
}
|
||||||
|
|
||||||
public function comments()
|
public function comments()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Comment::class);
|
return $this->hasMany(Comment::class);
|
||||||
|
|||||||
Reference in New Issue
Block a user