Download the PHP package goldnead/statamic-certificates without Composer

On this page you can find all versions of the php package goldnead/statamic-certificates. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package statamic-certificates

Statamic Certificates

Completion certificates for Statamic 6. When a learner finishes a course in statamic-courses, a certificate is issued: a PDF with the learner's name, the course, the date and your brand, and a public verification page where anyone holding the certificate's code can check that it is genuine and not revoked.

Commercial.

Requirements

Install

That is all. The next CourseCompleted issues a certificate. For courses finished before the addon was installed:

One by hand, for a learner who completed the course (a completed enrollment in statamic-courses; --force issues without one, --no-mail suppresses the mail):

Brand on the console. The console has no current brand, so each certificate is issued in the brand the course's Statamic site maps to (brand-context.sites), or the one --brand=<handle> names. With multi-brand off, the default brand is used. With multi-brand on, one brand only, that one. With multi-brand on, several brands and neither, the command refuses rather than stamp the default brand's issuer on another brand's certificate.

When is a course "completed"

Whenever statamic-courses fires CourseCompleted: every lesson completed, milestones included. That is statamic-courses' definition, not this addon's, and it includes lessons skipped by a test-out: a learner who tested out of a phase gets the certificate without having opened those lessons. If a certificate should mean "did every lesson", that is a decision for the course design (no test-out lessons), not a setting here.

How issuing works

PHP API

issue() throws a CertificateRefused (CourseNotFound, LearnerNameMissing) when it cannot issue, and runs in the current brand: call it inside BrandContext::runFor() from a job or command.

$user is a Statamic user, the auth guard's user model, or a user id. It is stored as user plus the auth identifier, the same id statamic-courses keys progress on. Any other Eloquent model is stored under its morph class.

Events: Goldnead\Certificates\Events\CertificateIssued and CertificateRevoked, both carrying the Certificate model, and CertificateNotIssued (subject id, course id, reason, message).

Front end

Two routes, inside the web group, both throttled (certificates.routes.throttle, default 30,1):

Route Name What
GET /certificates/verify/{code} certificates.verify Public. Valid, revoked or unknown, with learner, course, date and issuer.
GET /certificates/{code}/download certificates.download The PDF, for the signed-in owner only.

The verification page answers an unknown code and a malformed one with the same page, status and headers, so it cannot be used to probe which codes exist. The revocation reason is not shown publicly. A guest asking for a download gets 403, another user 404 (as if the code did not exist), the owner of a revoked certificate 410.

CERTIFICATES_ROUTES_ENABLED=false removes both routes; the tags then return no URLs.

Antlers

Fields: code, code_formatted, course_id, course_title, learner_name, issued_at, is_revoked, download_url (null when revoked), verify_url. Always for the signed-in user; a guest gets nothing. With no certificates the pair renders nothing, or its {{ if no_results }}…{{ /if }} branch when the template has one.

Template and brand

Under Settings in the Control Panel (the shared settings screen of statamic-brand-context), per brand: issuer name, logo, signature image, signatory name and title, accent colour, footer text, and whether to mail the PDF. Logo and signature are asset references (assets::logos/logo.png); they are embedded into the PDF, nothing is fetched over the network. Unset values fall back to config/certificates.php.

A certificate belongs to the brand that was current when it was issued. Issuer and signatory are frozen on the certificate then; logo, signature image, accent colour and footer are read from that brand's current settings whenever the PDF is rendered, whichever brand serves the download.

To change the layout, publish the views and edit them:

pdf.blade.php (A4 landscape, dompdf reads CSS 2.1: tables, not flexbox), verify.blade.php (the public page, plain HTML so it works without a theme) and mail.blade.php. The variables the PDF view receives are listed in CertificatePdf::viewData().

Storage

Generated PDFs live on certificates.storage.disk (default local) under certificates/{code}.pdf. The row is the record, the file is a cache: a missing file is rendered again on the next download, and revoking deletes it. Use a private disk; files are only served through the download route. A changed logo, colour or footer applies to PDFs rendered afterwards; delete the folder to re-render existing ones (issuer and signatory stay as issued).

Mail

CERTIFICATES_MAIL_ENABLED=true (or the setting per brand) queues a mail with the PDF attached when a certificate is issued. Off by default. The switch is read in the certificate's brand. The backfill never mails unless --mail is passed; certificates:issue --no-mail and Certificates::withoutMail() suppress it for one run. The mail goes out through the default mailer and sender.

Control Panel

Certificates lists the current brand's certificates with search and sort, a link to each verification page, and Revoke with a required reason (shown only in the CP). Permission: manage certificates. The template settings need manage certificates settings. certificates.cp.enabled hides the screen.

Configuration

config/certificates.php: issue_on_completion, template.*, storage.*, mail.enabled, routes.enabled|prefix|throttle, cp.enabled.

Testing


All versions of statamic-certificates with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
dompdf/dompdf Version ^3.1
goldnead/statamic-brand-context Version ^1.13
goldnead/statamic-courses Version ^0.1 || ^0.2 || ^0.3
laravel/framework Version ^12.40|^13.0
statamic/cms Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package goldnead/statamic-certificates contains the following files

Loading the files please wait ...