Download the PHP package sujan/laraform without Composer

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

YAML, JSON to html form with validation for laravel

Developing rapid forms from YAML and JSON, when large number of input fields will be required as well as frequent addition and deduction of form fields.

Installation

As sujan/laraform package is based on laravelcollective/html you have to add your new provider to the providers array of config/app.php:

Finally, add two class aliases to the aliases array of config/app.php:

Then run the command

It will give you a laraform.css file in /css/laraform.css

Then add laraform.css to your master template like

Usage

This package has multi purpose usage. You will get all the facilities of Laravel Collective as well as facilities of sujan/laraform package. We developed this package based on real life scenario.

Scenario 1

Say you have to develop a key value store where all of your application settings will reside. The kick here is to add more and more new keys when needed but no code modification will be needed. Then this is the right package for you. All you have to do is to write a YAML or JSON file for your form.

Scenario 2

Let's assume the values of your settings will come as a nested object and you have to make a form for the object then this package is a good choice. It will build the form for you within a few minutes all you have to do is write the JSON or YAML file based on the JSON object.

How to Use

Use it inside form tag in your form like

Laraform support input types text, email, password, number, hidden, date, file, textarea, checkbox, select, radio, checkboxlist, section;

Example 1

Let's say you have a users table and a usersmeta table. In users table you will save name,email, password and in usersmeta table you want to save date_of_birth, color, gender, address, favourites, profile_pic. Your yaml and json file will be like below. Where usermeta is relation name. Our package will parse the form for you.

Sample YAML for Example 1

Sample JSON for Example 1

Here span left, right is used to push the input fields to left and right. If you don’t specify span then the span will be full by default.

Sample create form

Html form of sample YAML and JSON.

Sample form

Form validation rule:

Html form of sample YAML and JSON with validation message.

Sample form with validation

The YAML and JSON files work for both create and edit page, all you have to do is to pass the model instance or JSON object.

Sample edit form for the above example.

Here variable $model is model instance or JSON object like below.

Sample JSON object

Sample edit form of the above JSON object

Sample edit form

Sample edit form with validation message

Sample edit form with validation

The yaml and json file for the above object will be #Sample 1's two files.

Form validation

You have to use laravel's form validation methodology. The error message handling is included in the package. So you don't have to write code for showing error messages. The message will be shown below the input field marked red.


All versions of laraform with dependencies

PHP Build Version
Package Version
Requires symfony/yaml Version >=v5.3.6
laravelcollective/html Version ^v6.0.3
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 sujan/laraform contains the following files

Loading the files please wait ....