{"id":13759890,"url":"https://github.com/glhd/aire","last_synced_at":"2025-05-15T14:08:11.427Z","repository":{"id":33220284,"uuid":"148830826","full_name":"glhd/aire","owner":"glhd","description":"Modern form builder for Laravel","archived":false,"fork":false,"pushed_at":"2025-03-04T15:44:20.000Z","size":1731,"stargazers_count":543,"open_issues_count":10,"forks_count":39,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-11T05:34:23.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://airephp.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/glhd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-14T19:04:40.000Z","updated_at":"2025-03-21T04:57:33.000Z","dependencies_parsed_at":"2024-03-12T16:49:07.052Z","dependency_job_id":null,"html_url":"https://github.com/glhd/aire","commit_stats":{"total_commits":356,"total_committers":14,"mean_commits":"25.428571428571427","dds":0.4438202247191011,"last_synced_commit":"35a2d6dedcc314d3520d387784a3311f97161112"},"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glhd%2Faire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glhd%2Faire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glhd%2Faire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glhd%2Faire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glhd","download_url":"https://codeload.github.com/glhd/aire/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355335,"owners_count":22057354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T13:01:00.519Z","updated_at":"2025-05-15T14:08:06.412Z","avatar_url":"https://github.com/glhd.png","language":"PHP","readme":"\n\u003cdiv class=\"mb-6 float-right inline-flex\"\u003e\n\t\u003ca href=\"https://github.com/glhd/aire/actions\" target=\"_blank\" class=\"mx-1\"\u003e\n\t\t\u003cimg \n\t\t\tsrc=\"https://github.com/glhd/aire/workflows/PHPUnit/badge.svg\" \n\t\t\talt=\"Build Status\" \n\t\t/\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://codeclimate.com/github/glhd/aire/test_coverage\" target=\"_blank\" class=\"mx-1\"\u003e\n\t\t\u003cimg \n\t\t\tsrc=\"https://api.codeclimate.com/v1/badges/f597a6e8d9f968a55f03/test_coverage\" \n\t\t\talt=\"Coverage Status\" \n\t\t/\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://packagist.org/packages/glhd/aire\" target=\"_blank\" class=\"mx-1\"\u003e\n        \u003cimg \n            src=\"https://poser.pugx.org/glhd/aire/v/stable\" \n            alt=\"Latest Stable Release\" \n        /\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"./LICENSE\" target=\"_blank\" class=\"mx-1\"\u003e\n        \u003cimg \n            src=\"https://poser.pugx.org/glhd/aire/license\" \n            alt=\"MIT Licensed\" \n        /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://twitter.com/airephp\" target=\"_blank\" class=\"mx-1\"\u003e\n        \u003cimg \n            src=\"https://img.shields.io/twitter/follow/airephp?style=social\" \n            alt=\"Follow @airephp on Twitter\" \n        /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://twitter.com/inxilpro\" target=\"_blank\" class=\"mx-1\"\u003e\n        \u003cimg \n            src=\"https://img.shields.io/twitter/follow/inxilpro?style=social\" \n            alt=\"Follow @inxilpro on Twitter\" \n        /\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n\u003ch1\u003e\n\t\u003ca href=\"https://airephp.com\"\u003e\n\t\t\u003cimg src=\"https://airephp.com/logo.svg\" width=\"192\" height=\"181\" alt=\"Aire\" border=\"0\" /\u003e\n\t\u003c/a\u003e\n\u003c/h1\u003e\n\nAire is a modern Laravel form builder ([demo](https://airephp.com)) with a\nfocus on the same expressive and beautiful code you expect from the Laravel\necosystem.\n\n## Basic Usage\n\nThe most common usage is via the `Aire` facade in your blade templates. All method calls\nare fluent, allowing for easy configuration of your form components:\n\n```php\n{{ Aire::open()\n  -\u003eroute('users.update')\n  -\u003ebind($user) }}\n\n{{ Aire::input('given_name', 'First/Given Name')\n    -\u003eid('given_name') }}\n    \n{{ Aire::input('family_name', 'Last/Family Name')\n    -\u003eid('family_name')\n    -\u003eautoComplete('off') }}\n  \n{{ Aire::email('email', 'Email Address')\n    -\u003ehelpText('Please use your company email address.') }}\n  \n{{ Aire::submit('Update User') }}\n  \n{{ Aire::close() }}\n```\n\n### Blade Components\n\nAs of Aire 2.4.0, you can also use all Aire elements as [Blade Components](https://laravel.com/docs/8.x/blade#components).\nThe above form is identical to:\n\n```html\n\u003cx-aire::form route=\"users.update\" :bind=\"$user\"\u003e\n\n    \u003cx-aire::input \n        name=\"given_name\" \n        label=\"First/Given Name\" \n        id=\"given_name\" \n    /\u003e\n    \u003cx-aire::input \n        name=\"family_name\" \n        label=\"Last/Family Name\" \n        id=\"family_name\" \n        auto-complete=\"off\" \n    /\u003e\n    \u003cx-aire::email \n        name=\"email\" \n        label=\"Email Address\" \n        help-text=\"Please use your company email address.\" \n    /\u003e\n    \n    \u003cx-aire::submit label=\"Update User\" /\u003e\n    \n\u003c/x-aire::form\u003e\n```\n\n## Installation\n\nInstall via composer with:\n```sh\ncomposer require glhd/aire\n```\n\n## Customization\n\nAire comes with classes that should work with the default Tailwind class names\nout of the box (`.bg-blue-600` etc). If you need to change the default class names\nfor any given element, there are two different ways to go about it.\n\nThe first is to publish the `aire.php` config file via `php artisan vendor:publish --tag=aire-config`\nand update the `default_classes` config for the element you'd like to change:\n\n```php\nreturn [\n  'default_classes' =\u003e [\n    'input' =\u003e 'text-gray-900 bg-white border rounded-sm',\n  ],\n];\n```\n\nThe second option is to publish custom views via `php artisan vendor:publish --tag=aire-views`\nwhich gives you total control over component rendering. There's a view file for each component\ntype (`input.blade.php` etc) as well as for component grouping. This gives you the most\nflexibility, but means that you have the maintain your views as Aire releases add new\nfeatures or change component rendering.\n\n## Configuration\n\nWhen you publish the `aire.php` config file via `php artisan vendor:publish --tag=aire-config`,\nthere are a handful of other configuration options. The config file is fully documented,\nso go check it out!\n\n## Data Binding\n\nAire automatically binds old input to your form so that values are preserved if a validation\nerror occurs. You can also bind data with the `bind()` method.\n\n```php\n// Bind Eloquent models\nAire::bind(User::find(1));\n\n// Bind an array\nAire::bind(['given_name' =\u003e 'Chris']);\n\n// Bind any object\nAire::bind((object) ['given_name' =\u003e 'Chris']);\n```\n\n### Binding Precedence\n\nBinding is applied in the following order:\n\n  1. Values set with `value()` are applied no matter what\n  2. Old input is applied if available\n  3. Bound data is applied last\n\n## Method Spoofing \u0026 Inference\n\nAire will automatically add the Laravel `_method` field for forms that are not `GET` or `POST`.\nIt will also automatically infer the intended method from the route if possible.\n\n```php\n// In routes\nRoute::delete('/photos/{photo}', 'PhotosController@destroy')\n\t-\u003ename('photos.destroy');\n\n// In your view\n{{ Aire::open()-\u003eroute('photos.destroy', $photo) }}\n{{ Aire::close() }}\n```\n\nWill generate the resulting HTML:\n\n```html\n\u003cform action=\"/photos/1\" method=\"POST\"\u003e\n\u003cinput type=\"hidden\" name=\"_method\" value=\"DELETE\" /\u003e\n\u003c/form\u003e\n```\n\n## Automatic CSRF Field\n\nAire will automatically inject a CSRF token if one exists and the form is not a `GET` form.\nSimply enable the session and a hidden `_token` field will be injected for you.\n\n## Server-Side Validation\n\nIf you run validations on the server, Aire will pick up any errors and automatically\napply error classes and show error messages within the associated input's group.\n\nYou can also include an error summary, which provides an easy way to show your users \nan error at the top of the page if validation failed.\n\n```php\n// Print \"There are X errors on this page that you must fix before continuing.\"\n{{ Aire::summary() }}\n\n// Also include an itemized list of errors\n{{ Aire::summary()-\u003everbose() }}\n```\n\n## Client-Side Validation\n\nJavascript validation in Aire is in its early stages. Browser testing is limited, and the\nJavascript code hasn't had an performance optimizations applied. That said, Aire\nsupports automatic client-side validation—simply pass an array of rules or a `FormRequest`\nobject and Aire will automatically apply most rules on the client side (thanks\nto [validatorjs](https://github.com/skaterdav85/validatorjs)!). \n\n## Laravel Version Support\n\nAire should run on Laravel 5.8.28 and higher, and PHP 7.1 and higher. Our policy is to test\nthe last two major releases of PHP and Laravel, so support below that is not guaranteed.\n\n## Translations\n\nAire comes with support for a handful of languages (feel free to submit a PR!). If you would\nlike to add your own translations, you can do so by publishing them with:\n\n```bash\nphp artisan vendor:publish --tag=aire-translations\n```\n\n## Under Consideration / Feature Ideas\n\nThere are a few things that are still either in-the-works or being considered for a \nlater release. These include:\n\n  - [Read-only plain text](http://getbootstrap.com/docs/4.1/components/forms/#readonly-plain-text) \n  - Cross-browser support for custom checkboxes and radio buttons via a config option\n  - Support for Choices.js or similar `\u003cselect\u003e` UI libraries\n  - Better handling of file inputs\n  - Better support for [prepending or appending content to inputs](https://getbootstrap.com/docs/4.0/components/input-group/#basic-example)\n","funding_links":[],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglhd%2Faire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglhd%2Faire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglhd%2Faire/lists"}