### Install and publish migrations Source: https://github.com/roundly-consulting/certificates-for-laravel/blob/main/README.md Run these commands to install the package, publish its migrations, and run them. Requires PHP 8.4 with ext-openssl and ext-json, and Laravel 12 or 13. ```bash composer require roundly-consulting/certificates-for-laravel php artisan vendor:publish --tag="certificates-migrations" php artisan migrate ``` -------------------------------- ### Schedule sync and renewal, and manage registry Source: https://github.com/roundly-consulting/certificates-for-laravel/blob/main/README.md Schedule the certificates:sync command every five minutes to update statuses and fire CertificateIssued, and certificates:renew daily to renew certificates within renewal.threshold_days. Then query status, find certificates, list expiring ones, and revoke certificates. ```php use Illuminate\Support\Facades\Schedule; Schedule::command('certificates:sync')->everyFiveMinutes(); // Requested → Issued, fires CertificateIssued Schedule::command('certificates:renew')->daily(); // everything inside renewal.threshold_days Certificates::status('shop.example.com'); // CertificateStatus::Issued once synced Certificates::find('shop.example.com')?->daysUntilExpiry(); // 90 Certificates::expiring(14); // Collection, soonest first Certificates::revoke('shop.example.com', 'key compromise'); ``` -------------------------------- ### Request a certificate with Certificates facade Source: https://github.com/roundly-consulting/certificates-for-laravel/blob/main/README.md Use the Certificates facade to request a SAN certificate for multiple hosts and attach it to an owner model. On the default kubernetes driver, cert-manager issues it in the background; the status is Requested initially (Issued for acme and filesystem drivers). ```php use RoundlyConsulting\Certificates\Facades\Certificates; $certificate = Certificates::for('shop.example.com') ->alsoFor('www.shop.example.com') ->owner($tenant) // a model using the HasCertificates trait ->issue(); $certificate->status; // CertificateStatus::Requested (acme, filesystem: Issued) ```