PHP code example of roundly-consulting / certificates-for-laravel

1. Go to this page and download the library: Download roundly-consulting/certificates-for-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

roundly-consulting / certificates-for-laravel example snippets


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)

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<int, Certificate>, soonest first
Certificates::revoke('shop.example.com', 'key compromise');
bash
composer vendor:publish --tag="certificates-migrations"
php artisan migrate