Changeset View
Changeset View
Standalone View
Standalone View
src/app/UserPassword.php
Show All 10 Lines | |||||
* @property int $user_id | * @property int $user_id | ||||
* @property string $password | * @property string $password | ||||
*/ | */ | ||||
class UserPassword extends Model | class UserPassword extends Model | ||||
{ | { | ||||
/** @var bool Indicates if the model should be timestamped. */ | /** @var bool Indicates if the model should be timestamped. */ | ||||
public $timestamps = false; | public $timestamps = false; | ||||
/** @var array The attributes that should be mutated to dates. */ | /** @var array<string, string> The attributes that should be cast. */ | ||||
protected $dates = ['created_at']; | protected $casts = [ | ||||
'created_at' => 'datetime:Y-m-d H:i:s', | |||||
]; | |||||
/** @var array The attributes that are mass assignable. */ | /** @var array<int, string> The attributes that are mass assignable. */ | ||||
protected $fillable = ['user_id', 'password']; | protected $fillable = ['user_id', 'password']; | ||||
/** @var array The attributes that should be hidden for arrays. */ | /** @var array<int, string> The attributes that should be hidden for arrays. */ | ||||
protected $hidden = ['password']; | protected $hidden = ['password']; | ||||
/** | /** | ||||
* The user to which this entry belongs. | * The user to which this entry belongs. | ||||
* | * | ||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo | ||||
*/ | */ | ||||
public function user() | public function user() | ||||
{ | { | ||||
return $this->belongsTo('\App\User', 'user_id', 'id'); | return $this->belongsTo(User::class, 'user_id', 'id'); | ||||
} | } | ||||
} | } |