fix: update user model
This commit is contained in:
+28
-4
@@ -8,11 +8,11 @@ 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
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $first_name
|
||||
* @property string $last_name
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user