Commands

Refresh Token

When using Xero as a background process, tokens will need to be renewed, to automate this process use the command:

php artisan xero:keep-alive

This will refresh the token when it's due to expire.

It's recommended to add this to a schedule.

use Dcblogdev\Xero\Console\Commands\XeroKeepAliveCommand;

protected function schedule(Schedule $schedule)
{
    $schedule->command(XeroKeepAliveCommand::class)->everyFiveMinutes();
}

Usage

php artisan xero:keep-alive

Show all tokens

To show all tokens within the database run:

php artisan xero:show-all-tokens

This will show all tokens stored in the database:

All XERO Tokens in storage

+----+-------------+--------------------------------------+-----------------------------+
| id | tenant_name | tenant_id                            | updated_at                  |
+----+-------------+--------------------------------------+-----------------------------+
| 1  |             | acc854f7-44fd-4683-9c11-66613d457ff4 | 2025-05-19T07:26:10.000000Z |
+----+-------------+--------------------------------------+-----------------------------+

Copyright © 2006 - 2025 DC Blog - All rights reserved.