Download the PHP package reecem/static-form without Composer

On this page you can find all versions of the php package reecem/static-form. 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 static-form

Handle static form submissions and other static site things in Laravel app

Latest Version on Packagist PHPUnit Tests Total Downloads Styling

Handle Static form submissions inside your Laravel app from Next.JS and Netlify or any other static site server.

Installation

You can install the package via composer:

To install the application you can do the following:

This will install the config file and the service provider, you can though opt for each one separately or use the following:

You can publish the config file with:

You can publish the Service Provider file with:

You will need to add the following to the config/app.php file:

You can view the docs here https://static-form.pkgpg.dev

Usage

As an overview, the usage of the current version is that you can use the packages middleware on controllers that you define, this will then use your controller to handle the request data.

Create The Token

The first step is to generate your token, to do that you can use the console command:

This will generate your token, it will show you the plain text version only during that session.

The other way is to call the API endpoint to generate a new one. The API is secured via the Gate that is defined in the App\Providers\StaticFormServiceProvider::class

You can define any logic in there that would allow only authorized people to access the application.

To call the API endpoint, for now you can make a request to the endpoint through a custom UI and javascript code.

Method Endpoint Description
GET domain.tld/api/static-form/token This will return a 200 status and the static-form package version if the toke is found
POST PATCH domain.tld/api/static-form/token A POST or PATCH request to this endpoint will create a new token

The url part that says static-form can be changed and comes from the config key static-form.path

The response for creating a token would be the following JSON with a 201 status:

Use the Middleware

To use the middleware, you can define a route using the config file, I do suggest that you use the API endpoint, this is as it is stateless and also would not require the CSRF token.

Submitting Forms

On your static site, you can have your contact form. The way of handling the form is done using the API part of the hosting provider.

So for Vercel apps, you can create a new file under the api directory.

For the API part of the code:

You can try a simple form layout for the frontend:

Testing

Testing is currently a work in progress, there are some :), I am manually testing it in an actual application to make sure it works though.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of static-form with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
illuminate/contracts Version ^7.0|^8.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 reecem/static-form contains the following files

Loading the files please wait ....