npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

laraform

v1.2.4

Published

Laraform Community Edition (Vue.js)

Downloads

31

Readme

Dynamic Form Builder for Laravel with Vue.js

Create even the most complex forms with ease, using two-sided validation, eloquent, nested elements, conditional logic, wizards and many more.

Laraform Community Edition (Vue.js)

Laraform is a premium library aiming to become the world's best form builder tool for web developers. It enhances collaboration by standardizing the creation of forms and increases efficiency by eliminating tons of repetitive work. Laraform comes with a lighter "Community Edition" and a full version which can be purchased at our website.

Features

Full features of Laraform:

  • Two-sided validation
  • 54 Laravel compatible frontend validators
  • Eloquent ORM support
  • Multiple file uploads
  • 34+ built-in elements
  • Nested elements
  • Repeatable elements
  • Translatable elements
  • Conditional logic
  • Form wizard
  • Localization
  • Theming
  • Extensibility

Examples

Browser Support

Laraform aims to support the latest versions of:

  • Google Chrome
  • Firefox
  • Apple Safari
  • Microsoft Edge
  • Opera
  • Safari iOS
  • Chrome, Firefox and Default Browser Android

Installation

Laraform is a full-stack library which comes with a separate frontend and backend library. This will install Laraform's Community Edition. For the full package please check out our website.

Install frontend library for Vue.js:

npm i laraform --save

Make sure you have the following peer dependencies installed:

npm i axios lodash moment vue --save

Install backend library for Laravel:

composer require laraform/laraform-laravel

Publish assets:

php artisan vendor:publish

When asked, choose: Laraform\LaraformServiceProvider. This will publish a config file at config/laraform.php.

Usage

Create a form at app\Forms\FirstForm.php:

<?php

namespace App\Forms;

class FirstForm extends \Laraform
{
  public function schema() {
    return [
      'hello_world' => [
        'type' => 'text',
        'label' => 'Hello',
        'default' => 'World'
      ]
    ];
  }
}

Pass the form to view in routes/web.php using app() function:

Route::get('/', function () {
  return view('welcome', [
    'form' => app('App\Forms\FirstForm')
  ]);
});

Set up rendering in view in resources/views/welcome.blade.php:

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>Laravel</title>

    <link rel="stylesheet" type="text/css" href="/css/app.css">
  </head>
  <body>
    <div id="app">
      {!! $form->render() !!}
    </div>

    <script src="/js/app.js"></script>
  </body>
</html>

Include Laraform in resources/js/app.js:

require('./bootstrap');

import Vue from 'vue'
import Laraform from 'laraform'

Vue.use(Laraform)

const app = new Vue({
  el: '#app',
})

Import theme in resources/sass/app.scss:

@import 'laraform/src/themes/default/scss/theme.scss';

If you are planning to use a CSS framework, like Bootstrap, make sure you include its theme file before Laraform's theme, so that Laraform can make use of the CSS framework's variables.

This is how it should look like in case of Bootstrap 4:

// Bootstrap 4's main theme file
@import 'bootstrap/scss/bootstrap';

// Laraform's theme file created for Bootstrap 4
@import 'laraform/src/themes/bs4/scss/theme.scss';

Laraform currently support Bootstrap 3 and Bootstrap 4. If you are using one of those also make sure to change the global theme in config/laraform.php to bs3 or bs4:

// ...
'theme' => 'bs4',

// ...

Compile your assets with:

npm run dev

Launch your site for example with:

php artisan serve

Now if you load the site you should see a very simple form with one single input. Check out our docs to learn how to create more advanced forms.

You can also download Examples to see more forms in action.

Feature Comparison

| | Full Version | Community Edition | | --- | --- | --- | | Backend support | ✔ | ✔ | | Elements | all | checkbox, checkbox group, hidden, key, meta, multiselect (native), password, radio, radio group, static, textarea, text | | File uploads | ✔ | - | | Nested elements | ✔ | - | | Custom elements | ✔ | ✔ | | Translatable elements | ✔ | - | | Localization | ✔ | ✔ | | Custom locales | ✔ | ✔ | | Validation | ✔ | ✔ | | Validation rules | all | accepted, alpha, alpha_dash, alpha_num, between, boolean, digits, digits_between, email, filled, in, integer, ip, ipv4, ipv6, json, max, min, not_in, not_regex, numeric, regex, required, size, string, timezone, url, uuid | | Custom rules | ✔ | ✔ | | Conditions | ✔ | - | | Tabs | ✔ | - | | Wizard | ✔ | - | | Events & hooks | ✔ | ✔ | | Buttons | ✔ | ✔ | | Themes | all | all | | Custom themes | ✔ | - | | Custom styles | ✔ | ✔ | | Custom layout | ✔ | ✔ | | Code splitting | ✔ | - | | | Get Full version | Try out Community Edition |

Documentation

A complete Developer Guide and API Reference is available at Laraform website.

Issue Tracking

Laraform uses GitHub Issues for official bug tracking. Please follow our issue template to help us hunt down bugs as efficiently as possible.

Support & Contribution

If you have any questions about Laraform or interested in contributing, please drop us a line at [email protected]. We are happy for receiving feedbacks as well as growing our enthusiastic developer team.

License

Laraform Community Edition comes with an GPL license so you are free to use this library in your projects. For the full version check out the license at our website.