Download the PHP package uams-web/statamic-alpine-csp-forms without Composer

On this page you can find all versions of the php package uams-web/statamic-alpine-csp-forms. 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-alpine-csp-forms

Alpine CSP Forms

A Statamic add-on that gives public forms a JavaScript driver safe under a Content Security Policy without 'unsafe-eval'. It registers the alpine_csp form JS driver, and ships the browser-side field-conditions evaluator the driver's output calls.

Statamic's stock alpine driver emits attribute expressions that the @alpinejs/csp build refuses to evaluate, so every conditional field on a public form fails to render. alpine_csp re-renders the two expressions that matter, and the add-on's front-end script supplies the $showField Alpine magic they call. If Statamic ships a CSP-safe driver of its own, removing this add-on returns the site to the stock driver.

Releases are 0.x pre-releases until 1.0.0: a minor release can carry a breaking change, and its release notes call it out first with the action to take.

Requirements

PHP 8.4 or later and Statamic 6.35 or later. The host loads Alpine itself, using the @alpinejs/csp build.

Installation

The add-on's service provider is discovered by Statamic and registers the driver under the handle alpine_csp. Statamic publishes the front-end script to public/vendor/statamic-alpine-csp-forms/frontend/alpine-csp.js after the install; php artisan vendor:publish --tag=statamic-alpine-csp-forms --force republishes it.

Usage

Select the driver on the form tag. The scoped form is unchanged:

Load the front-end script before the host's own Alpine bundle starts. As classic deferred scripts the two run in document order:

The script registers the $showField magic when Alpine dispatches alpine:init, so the host has to set window.Alpine before it calls Alpine.start(). A host that bundles the evaluator instead can import registerShowFieldMagic from resources/js/alpine-csp.js and call it with its Alpine instance.

Development

Developing against a host application is covered in the submission checklist. npm run build writes both the Control Panel build and the front-end script to resources/dist, which is committed.

License

MIT. See LICENSE.


All versions of statamic-alpine-csp-forms with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
statamic/cms Version ^6.35
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 uams-web/statamic-alpine-csp-forms contains the following files

Loading the files please wait ...