PHPackages                             aracademia/lightning - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. aracademia/lightning

ActiveLibrary[Templating &amp; Views](/categories/templating)

aracademia/lightning
====================

Create Laravel forms with a single line of code

1.0(11y ago)036MITPHPPHP &gt;=5.4.0

Since Jul 25Pushed 11y ago1 watchersCompare

[ Source](https://github.com/aracademia/Lightning)[ Packagist](https://packagist.org/packages/aracademia/lightning)[ RSS](/packages/aracademia-lightning/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Lightning Laravel Forms
=======================

[](#lightning-laravel-forms)

=========

*Create Laravel forms with a single line of code*

### Installation ( using composer )

[](#installation--using-composer-)

1. Add the code below to your `composer.json` file

 ``` "require-dev": { "aracademia/lightning": "~1.0" } ```

2. Run Composer update in your terminal 3. Add the service provider below to `app/config/app.php` under the `providers` array ```
    'Aracademia\Lightning\LightningFormServiceProvider'

    ```
4. Publish the config file by running the command below in your terminal. After that the config file will be placed under `app/config/packages/aracademia/lightning```` php artisan config:publish aracademia/lightning ```

### How to use the package

[](#how-to-use-the-package)

Let's use an example to see how easy this package is. We are going to create a contact us form. open a view file, make sure it has `.blade.php` extension, then enter the following code `{{Lightning::create('contact')}}`That's it. These three words will create a contact us form with the following fields: First Name, Last Name, Email, Message, Submit button using bootstrap styling, and the post url will be the current page url by default.

If you would like to create a login form, then all you have to do is change the name contact to login `{{Lightning::create('login')}}`That will create a login form with email and password fields. ######Ok, that's cool... but wait a minute! what if I want to add other fields or maybe edit the existing fields? what if I want to add attributes to my fields or override the class? how about changing the form action url?\* Don't worry, we got your back. This package is very flexible and customizable.

### Edit the config file

[](#edit-the-config-file)

Let's first start by editing the config file. Let's say we want to add a new form that allows the user to add their personal information to their profile.

1. Go to the config file, and add another nested array under the forms array with the form name and the fields

```
    "forms"   =>  [
        'contact'       => 'first_name,last_name,email,message',
        'login'         =>  'email,password',
        'register'      =>  'first_name,last_name,email,password,password_confirmation',
        'personalInfo'  =>  'age, telephone, homephone, favorite_movie'//...etc you got the idea

```

2. Go to your view where you want to place the form and call

 ``` {{Lightning::create('personalInfo')}} ```

You can add more fields or remove some from the existing forms in the config file to suit your needs.

The inputTypes array in the config file show some common input field names linked to their html 5 types, that way if you don't want to specify the type of an input manually, this array will set the correct input types to the name. For example, the email input name will have a type of `email` automatically instead of the default `text`You can add more names to the array, however keep in mind that the type of the name needs to be compatible with laravel Form facade. In addition, we can also override the type of any field. check the `Inline Customization` section below for more information

The rest of the config file are just bootstrap classes and div wrapper. You can change those if you are not using bootstrap.

### Inline Customization

[](#inline-customization)

The create method for the lightning form accepts 4 arguments Lightning::create(1,\[2\],\[3\],\[4\])

1. First argument is a string. It is the name of the form we want to create. ex: login, register, contact...
2. This argument uses the laravel form open argument. we can pass url, route, action, method...etc ex: `Lightning::create('register',['url'=>'login','method'=>'post'....])`
3. Here we can add or edit fields to the form and their attributes. make sure to separate the attribute name and value with a colon `:` and a comma `,` between the attributes. ex: `Lightning::form('create',['route'=>'product.create'],['name'=>'required:required, id:productName, class:bar'])`
4. Last argument is an array for the submit button. ex: `Lightning::create('survey',null,null,['name'=>'submit','value'=>'Send','class'=>'btn btn-primary'])`

Take a look at this example. We are going to customize the registration form

```
{{Lightning::create('register',['route'=>'register.create'],['age'=>'required:required,type:number','mobile'=>'type:tel'],['value'=>'Join','class'=>'btn btn-success'])}}

```

The code above will create a registration form with the default fields in the config file in addition to two new fields (age, mobile). if you want to override an existing field attributes, simply pass the name of the field and the attributes you want to add or override.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4361d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/44c1a8c914b5401989d132787ed1b23ee4ae4c4a8d1ba021d26b24c6121a3a03?d=identicon)[aracademia](/maintainers/aracademia)

---

Top Contributors

[![aracademia](https://avatars.githubusercontent.com/u/8220222?v=4)](https://github.com/aracademia "aracademia (16 commits)")[![rrafiatech](https://avatars.githubusercontent.com/u/7155667?v=4)](https://github.com/rrafiatech "rrafiatech (5 commits)")

---

Tags

laravelFormsLightningAracademia

### Embed Badge

![Health badge](/badges/aracademia-lightning/health.svg)

```
[![Health](https://phpackages.com/badges/aracademia-lightning/health.svg)](https://phpackages.com/packages/aracademia-lightning)
```

###  Alternatives

[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[glhd/aire

Modern Laravel form builder. Remembers old input, retrieves error messages and comes with beautiful Tailwind-based markup out of the box.

544282.7k9](/packages/glhd-aire)[hasinhayder/tyro-dashboard

Tyro Dashboard - Beautiful admin dashboard for managing Tyro roles, privileges, users, and settings

5443.8k](/packages/hasinhayder-tyro-dashboard)[ublabs/blade-simple-icons

A package to easily make use of Simple Icons in your Laravel Blade views.

1963.4k](/packages/ublabs-blade-simple-icons)[technikermathe/blade-lucide-icons

A package to easily make use of Lucide icons in your Laravel Blade views.

18421.4k11](/packages/technikermathe-blade-lucide-icons)[hasinhayder/tyro-login

Tyro Login - Beautiful, customizable authentication views for Laravel 12 &amp; 13

2464.9k6](/packages/hasinhayder-tyro-login)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
