init
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* 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_provience
|
||||
* @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 Model
|
||||
{
|
||||
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_provience',
|
||||
'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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user