I installed Laravel 9 and Sanctum, made a migration and tried to create token with 'createToken' method from User class which extends from Authenticatable. It's all from Laravel and Sanctum instalation. I used code below.
createToken('secrettoken')->plainTextToken;
And I've got an error message:
"message": "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'expires_at' in 'field list' (SQL: insert into `personal_access_tokens` (`name`, `token`, `abilities`, `expires_at`, `tokenable_id`, `tokenable_type`, `updated_at`, `created_at`) values (secrettoken, 4afa89fe2706656efae648c43c2a451b5b6d10be8b4e4558b6f9097706f814eb, [\"*\"], ?, 14, App\\Models\\User, 2022-08-02 19:30:00, 2022-08-02 19:30:00))
It seems 'createToken' method wants to fullfil an non-existing 'expires_at' column and doesn't have a value. This method has two arguments: name and abilitie (optional).
Did anyone has the same problem as me? Maybe I'm doing some wrong or using this method wrong.