Download the PHP package code16/formoj without Composer

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

Formoj for Laravel is a form generator package.


Example of a Formoj form (with de default style).

You can picture it like a small Google Form but with full control on it. Formoj takes care of the form storage and display, allows an administrator to manage forms (notifications, export answers in XLS format) and, of course, stores answers.

The project is separated in 3 modules:

Installation

Vue plugin

Basic

Advanced Configuration

config description
apiBaseUrl Base URL of the formoj API (define it as base_url in laravel in config/formoj.php)
scrollOffset Add offset to the automatic scroll top behavior, useful when there is a fixed header in the site.
locale Locale used in all forms messages, buttons, etc... If not set, the <html lang="en"> attribute is used.
i18n Localized messages to customize default formoj i18n messages, see lang files

Laravel module

Formoj requires Laravel 7+, Carbon 2.0+, and maatwebsite/excel 3.1+.

Install the package via composer:

Then run this to create the needed tables in the database:

You may publish the config file:

And the lang file, if you need to update or add a translation (consider a PR in this case):

Update Formoj

Warning: when updating Formoj with composer update code16/formoj, be sure to also execute npm install formoj to keep back and front code in line.

Create a form

With Sharp

If your project is already using Sharp 6 for Laravel, great. If not, and if you want to use it with Formoj, first install the package.

Then we need to configure Formoj in config/sharp.php:

You can of course adapt this, depending on your needs: use our own subclasses, tweak the menu...

This will add a full Formoj administration in Sharp:

Without Sharp

Formoj does not provide any other admin tool for now, so in this case, well, you're free to do as you want.

There are a couple methods to help you handle section and field creation, for instance:

Manage a form

Once again, with Sharp you'll find all the appropriate tooling. This section describes

Form availability

A form can optionally defined a published_at and/or a unpublished_at dates: outside this period, the form is displayed with an adapted message.

Form notifications

The form administrator can choose (for each form) to be notified by mail at formoj_form.administrator_email in two ways:

To configure the "grouped" strategy, you'll have to schedule the Code16\Formoj\Console\SendFormojNotificationsForYesterday Command, which will send all answers of yesterday.

Form sections

A Form is made of sections, which contains fields. If the form contains more than one section, it will be displayed one section at a time, with "Next" button.

Field types

Formoj can display these types of fields:

Embed a form

A given form can then be embedded anywhere with this DOM:

Work with answers

In addition to the notification system, the form administrator can export answers at any time on a xlsx format, via the Code16\Formoj\Job\ExportAnswersToXls job, which can be called this way:

Where:

Is Sharp is configured, it will provide a dedicated Command to handle this export (as well as one to display an answer).

Styling the form

Formoj uses SASS/SCSS language for styles. You can import the style with sass import:

The default theme is very basic and is meant to be customized by your own code. Some variable are available and can be overridden, see formoj/scss/_variables.scss

Bootstrap integration

The bootstrap theme bind all bootstrap's form classes to formoj elements. By default the form has a card appearance, you may want to reset that behavior.

In addition, the select and checkboxes can have the bootstrap's custom-control style

Contributing

Setup prototipoj

Build front-end


All versions of formoj with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2|^8.3
laravel/framework Version ^8.0|^9.0|^10.0|^11.0
nesbot/carbon Version ^2.0
maatwebsite/excel Version ^3.1
ext-zip Version *
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 code16/formoj contains the following files

Loading the files please wait ....