Skip to content

Corrected the expires_at field name used in the model and the flush tokens command

Robert Sinton requested to merge patch/expires_at_field_name into master

I noticed this cropping up in the Laravel single log:

[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'expires' in 'where clause' at /var/www/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:66)
[stacktrace]
#0 /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(485): Doctrine\\DBAL\\Driver\\PDOConnection->prepare('delete from `la...')

Looked into it and saw that the ::where() call in FlushTokensCommand.php, and also $fillable in the LaravelPems model, both refer to expires, but the migration creates the field as expires_at.

NOTE: I've set an expires_at value in the past onto one of the records in my laravel_pems table, but it hasn't been deleted yet. OTOH I haven't seen the above error crop up in the log again yet.

Merge request reports