PHP code example of goldnead / statamic-certificates
1. Go to this page and download the library: Download goldnead/statamic-certificates 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/ */
goldnead / statamic-certificates example snippets
use Goldnead\Certificates\Facades\Certificates;
$certificate = Certificates::issue($user, $courseEntryId); // idempotent, fires CertificateIssued once
Certificates::find($user, $courseEntryId); // or null
Certificates::for($user); // the user's certificates, newest first
Certificates::findByCode('abcd-efgh-…');
Certificates::revoke($certificate, 'Reason'); // fires CertificateRevoked
Certificates::pdf($certificate); // the PDF bytes; throws CertificateIsRevoked
Certificates::verifyUrl($certificate);
Certificates::downloadUrl($certificate);
Certificates::withoutMail(fn () => Certificates::issue($user, $id)); // issue without mailing