Files
airline-agency/app/Models/User.php
T

106 lines
1.9 KiB
PHP

<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticate;
/**
* Class User
*
* @property int $id
* @property string $first_name
* @property string $last_name
* @property int|null $file_id
* @property int|null $city_id
* @property int|null $province_id
* @property string $national_code
* @property int $gender
* @property int $marital_status
* @property string|null $spouse_name
* @property string $mobile
* @property string $email
* @property string $username
* @property string $password
* @property bool $status
* @property Carbon $created_at
* @property Carbon $updated_at
* @property string|null $deleted_at
*
* @property File|null $file
* @property Province|null $province
* @property City|null $city
* @property Collection|Booking[] $bookings
* @property Collection|Passenger[] $passengers
*
* @package App\Models
*/
class User extends Authenticate
{
use SoftDeletes;
protected $table = 'users';
public static $snakeAttributes = false;
protected $casts = [
'file_id' => 'int',
'city_id' => 'int',
'province_id' => 'int',
'gender' => 'int',
'marital_status' => 'int',
'status' => 'bool'
];
protected $hidden = [
'password'
];
protected $fillable = [
'first_name',
'last_name',
'file_id',
'city_id',
'province_id',
'national_code',
'gender',
'marital_status',
'spouse_name',
'mobile',
'email',
'username',
'password',
'status'
];
public function file()
{
return $this->belongsTo(File::class);
}
public function province()
{
return $this->belongsTo(Province::class);
}
public function city()
{
return $this->belongsTo(City::class);
}
public function bookings()
{
return $this->hasMany(Booking::class);
}
public function passengers()
{
return $this->hasMany(Passenger::class);
}
}