93 lines
1.7 KiB
PHP
93 lines
1.7 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Foundation\Auth\User as Authenticated;
|
|
|
|
/**
|
|
* Class User
|
|
*
|
|
* @property int $id
|
|
* @property string $first_name
|
|
* @property string $last_name
|
|
* @property string $national_code
|
|
* @property int $gender
|
|
* @property int $marital_status
|
|
* @property string|null $spouse_name
|
|
* @property string $mobile
|
|
* @property string $email
|
|
* @property int|null $file_id
|
|
* @property string $username
|
|
* @property string $password
|
|
* @property string $password_confirmation
|
|
* @property string $user_Province
|
|
* @property string $user_city
|
|
* @property int $status
|
|
* @property Carbon $created_at
|
|
* @property Carbon $updated_at
|
|
* @property Carbon $deleted
|
|
*
|
|
* @property File|null $file
|
|
* @property Collection|Booking[] $bookings
|
|
* @property Collection|Comment[] $comments
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class User extends Authenticated
|
|
{
|
|
protected $table = 'users';
|
|
|
|
protected $casts = [
|
|
'gender' => 'int',
|
|
'marital_status' => 'int',
|
|
'file_id' => 'int',
|
|
'status' => 'int',
|
|
'deleted' => 'datetime'
|
|
];
|
|
|
|
protected $hidden = [
|
|
'password'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'first_name',
|
|
'last_name',
|
|
'national_code',
|
|
'gender',
|
|
'marital_status',
|
|
'spouse_name',
|
|
'mobile',
|
|
'email',
|
|
'file_id',
|
|
'username',
|
|
'password',
|
|
'password_confirmation',
|
|
'user_Province',
|
|
'user_city',
|
|
'status',
|
|
'deleted'
|
|
];
|
|
|
|
public function file()
|
|
{
|
|
return $this->belongsTo(File::class);
|
|
}
|
|
|
|
public function bookings()
|
|
{
|
|
return $this->hasMany(Booking::class);
|
|
}
|
|
|
|
public function comments()
|
|
{
|
|
return $this->hasMany(Comment::class);
|
|
}
|
|
}
|