---
title: "Artisan commands — Certificates for Laravel | Roundly"
description: "Six commands to issue, list, renew, check, prune and sync certificates — with every option and ready-to-schedule examples."
url: https://roundly-consulting.com/open-source/docs/certificates-for-laravel/commands
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Certificates for Laravel](https://roundly-consulting.com/open-source/docs/certificates-for-laravel.md)

# Artisan commands

Six console commands cover the whole lifecycle from the terminal or the scheduler. issue, renew, prune and sync are thin callers of the facade root — Certificates::issue(), renewDue() / renew(), prune() and sync() — so Certificates::fake() records them and --connection targets the chosen registry. check scans with Certificates::expiring(); list is a read-only query of the registry model:

```bash
php artisan certificates:issue {domain} {--driver=} {--connection=}
php artisan certificates:list {--driver=} {--status=} {--expiring=} {--connection=}
php artisan certificates:renew {domain?} {--threshold=} {--queue} {--connection=}
php artisan certificates:check {--threshold=} {--alert} {--driver=} {--connection=}
php artisan certificates:prune {--days=30} {--status=} {--connection=}
php artisan certificates:sync {--driver=} {--connection=}
```

| Command | What it does |
| --- | --- |
| `certificates:issue` | Runs Certificates::issue() for one domain; --driver picks the driver, --connection the registry. Exits non-zero when it fails — an invalid domain, a provider error or a provisioning already in progress. |
| `certificates:list` | Lists registry rows by domain; filter by --driver, --status (a value such as issued), --expiring=N days and --connection. |
| `certificates:renew` | Runs Certificates::renewDue() — or renew() for one domain; --threshold overrides renewal.threshold\_days, --queue queues RenewCertificateJob. Prints each outcome and exits non-zero on any failure. |
| `certificates:check` | Scans expiring certificates — already expired ones included — fires CertificateExpiring and, with --alert or alerts.enabled, raises health alerts, checking each certificate on its own connection. Never renews. |
| `certificates:prune` | Runs Certificates::prune(): soft-deletes records not updated for --days (default 30) with status expired, failed or revoked — or only --status — and prints the count (Pruned 3 certificates.). |
| `certificates:sync` | Runs Certificates::sync(): pulls the provider’s certificates into the registry by driver and name — with live status, expiry, issuer, serial and fingerprint where reported — and revives pruned rows the provider still reports, except revoked ones. It settles in-flight rows with their events (requested → issued + CertificateIssued, renewing → renewed + CertificateRenewed, → failed + CertificateFailed) and never un-revokes a row. Prints the count (Synced 1 certificate from the kubernetes provider.). |

## Examples

```bash
php artisan certificates:issue shop.example.com --driver=acme
php artisan certificates:list --status=issued
php artisan certificates:list --expiring=14 --connection=tenant
php artisan certificates:renew --threshold=30 --queue
php artisan certificates:check --threshold=30 --alert
php artisan certificates:prune --days=60 --status=failed
php artisan certificates:sync --driver=kubernetes
```

## Scheduling

The package registers no schedule. A typical setup syncs every few minutes — on kubernetes, where issuance is asynchronous, that records the outcome — renews daily and scans for alerts:

```php
use Illuminate\Support\Facades\Schedule;

Schedule::command('certificates:sync')->everyFiveMinutes();  // kubernetes: Requested → Issued, fires CertificateIssued
Schedule::command('certificates:renew')->daily();
Schedule::command('certificates:check --alert')->daily();
```

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/certificates-for-laravel.md)
