fix: regenerate models and add database
This commit is contained in:
+37
-17
@@ -10,11 +10,10 @@ use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Foundation\Auth\User as Authenticated ;
|
||||
|
||||
/**
|
||||
* Class User
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $first_name
|
||||
* @property string $last_name
|
||||
@@ -27,32 +26,35 @@ use Illuminate\Foundation\Auth\User as Authenticated ;
|
||||
* @property int|null $image_id
|
||||
* @property string $username
|
||||
* @property string $password
|
||||
* @property string $password_confirmation
|
||||
* @property string $user_province
|
||||
* @property string $user_city
|
||||
* @property int $province_id
|
||||
* @property int $city_id
|
||||
* @property int|null $status
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updatet_at
|
||||
* @property string $deleted_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
|
||||
class User extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $table = 'users';
|
||||
public $timestamps = false;
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'gender' => 'int',
|
||||
'marital_status' => 'int',
|
||||
'image_id' => 'int',
|
||||
'status' => 'int',
|
||||
'updatet_at' => 'datetime'
|
||||
'province_id' => 'int',
|
||||
'city_id' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
@@ -71,11 +73,9 @@ class User extends Authenticated
|
||||
'image_id',
|
||||
'username',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
'user_province',
|
||||
'user_city',
|
||||
'status',
|
||||
'updatet_at'
|
||||
'province_id',
|
||||
'city_id',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function file()
|
||||
@@ -83,8 +83,28 @@ class User extends Authenticated
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user