Files
shahrzadzandi09/app/Models/User.php
T

68 lines
1.2 KiB
PHP

<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Foundation\Auth\User as Authenticate;
/**
* Class User
*
* @property int $id
* @property string $first_name
* @property string $last_name
* @property string $email
* @property string $mobile
* @property string $password
* @property string|null $national_code
* @property Carbon|null $birth_date
* @property int $status
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property Collection|Comment[] $comments
* @property Collection|Favorite[] $favorites
*
* @package App\Models
*/
class User extends Authenticate
{
protected $table = 'users';
public static $snakeAttributes = false;
protected $casts = [
'birth_date' => 'datetime',
'status' => 'int'
];
protected $hidden = [
'password'
];
protected $fillable = [
'first_name',
'last_name',
'email',
'mobile',
'password',
'national_code',
'birth_date',
'status'
];
public function comments()
{
return $this->hasMany(Comment::class);
}
public function favorites()
{
return $this->hasMany(Favorite::class);
}
}