ログインしようとしたときにユーザーアカウントがまだ有効かどうかを確認するために、データベースに有効期限を保存する必要があります。
これは私のユーザーモデルです:
class User extends Model implements AuthenticatableContract, CanResetPasswordContract {
use Authenticatable, CanResetPassword;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
protected $dates = [
'expiration_date'
];
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'first_name',
'last_name',
'email',
'password',
'expiration_date'
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = [
'password',
'remember_token'
];
/**
* Questa funzione fa in modo di criptare in automatico la password quando si crea un utente
*
* @param $password
*
* @return string
*/
public function setPAsswordAttribute( $password )
{
return $this->attributes['password'] = bcrypt( $password );
}
public function setExpirationDateAttribute( $expiration )
{
return $this->attributes['expiration_date'] = Carbon::createFromDate('Y-m-d', $expiration);
}
}
私のフォームには、日付ピッカーを使用してタブをフォーマットに設定するテキスト入力がありdd/mm/yyyy
ます。
DBで送信を押すと、0000-00-00 00:00:00
何が問題ですか?