{"id":13669601,"url":"https://github.com/formers/former","last_synced_at":"2025-12-16T19:15:22.265Z","repository":{"id":4670642,"uuid":"5816879","full_name":"formers/former","owner":"formers","description":"A powerful form builder, for Laravel and other frameworks (stand-alone too)","archived":false,"fork":false,"pushed_at":"2025-03-11T09:34:48.000Z","size":3179,"stargazers_count":1340,"open_issues_count":6,"forks_count":205,"subscribers_count":63,"default_branch":"master","last_synced_at":"2025-03-20T00:41:08.328Z","etag":null,"topics":["form-builder","laravel-package"],"latest_commit_sha":null,"homepage":"https://formers.github.io/former/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/formers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"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":"2012-09-15T02:21:29.000Z","updated_at":"2025-03-11T09:32:50.000Z","dependencies_parsed_at":"2024-06-03T10:41:34.179Z","dependency_job_id":"073bfd3b-b766-4f1e-99ea-f9a87b1e099c","html_url":"https://github.com/formers/former","commit_stats":{"total_commits":1066,"total_committers":69,"mean_commits":15.44927536231884,"dds":0.3283302063789869,"last_synced_commit":"45d37aed4c42a3a66f7304ab2bff029a846c1b5f"},"previous_names":["anahkiasen/former"],"tags_count":70,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formers%2Fformer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formers%2Fformer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formers%2Fformer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formers%2Fformer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/formers","download_url":"https://codeload.github.com/formers/former/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250513271,"owners_count":21443190,"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":["form-builder","laravel-package"],"created_at":"2024-08-02T08:01:18.710Z","updated_at":"2025-12-16T19:15:16.897Z","avatar_url":"https://github.com/formers.png","language":"PHP","funding_links":[],"categories":["PHP","其他( Miscellaneous )"],"sub_categories":[],"readme":"# Former\r\n## A Laravelish way to create and format forms\r\n\r\n[![Latest Stable Version](http://img.shields.io/packagist/v/anahkiasen/former.svg?style=flat)](https://packagist.org/packages/anahkiasen/former)\r\n[![Total Downloads](http://img.shields.io/packagist/dt/anahkiasen/former.svg?style=flat)](https://packagist.org/packages/anahkiasen/former)\r\n\r\nFormer outputs form elements in HTML compatible with your favorite CSS framework (Bootstrap and Foundation are currently supported). Former also handles repopulation after validation errors, including automatically rendering error text with affected fields.\r\n\r\n### Introduction\r\n\r\nFormer provides a fluent method of form creation, allowing you to do:\r\n\r\n```php\r\nFormer::framework('TwitterBootstrap3');\r\n\r\nFormer::horizontal_open()\r\n  -\u003eid('MyForm')\r\n  -\u003erules(['name' =\u003e 'required'])\r\n  -\u003emethod('GET');\r\n\r\n  Former::xlarge_text('name') # Bootstrap sizing\r\n    -\u003eclass('myclass') # arbitrary attribute support\r\n    -\u003elabel('Full name')\r\n    -\u003evalue('Joseph')\r\n    -\u003erequired() # HTML5 validation\r\n    -\u003ehelp('Please enter your full name');\r\n\r\n  Former::textarea('comments')\r\n    -\u003erows(10)\r\n    -\u003ecolumns(20)\r\n    -\u003eautofocus();\r\n\r\n  Former::actions()\r\n    -\u003elarge_primary_submit('Submit') # Combine Bootstrap directives like \"lg and btn-primary\"\r\n    -\u003elarge_inverse_reset('Reset');\r\n\r\nFormer::close();\r\n```\r\n\r\nEvery time you call a method that doesn't actually exist, Former assumes you're trying to set an attribute and creates it magically. That's why you can do in the above example `-\u003erows(10)` ; in case you want to set attributes that contain dashes, just replace them by underscores : `-\u003edata_foo('bar')` equals `data-foo=\"bar\"`.\r\nNow of course in case you want to set an attribute that actually contains an underscore you can always use the fallback method `setAttribute('data_foo', 'bar')`. You're welcome.\r\n\r\nThis is the core of it, but Former offers a lot more. I invite you to consult the wiki to see the extent of what Former does.\r\n\r\n-----\r\n\r\n### Installation\r\nRequire Former package using Composer:\r\n\r\n    composer require anahkiasen/former\r\n\r\nPublish config files with artisan:\r\n    \r\n    php artisan vendor:publish --provider=\"Former\\FormerServiceProvider\"\r\n\r\n#### App.php config for Laravel 5.4 and below\r\n\r\nFor Laravel 5.4 and below, you must modify your `config/app.php`.\r\n\r\nIn the `providers` array add :\r\n\r\n    Former\\FormerServiceProvider::class\r\n\r\nAdd then alias Former's main class by adding its facade to the `aliases` array in the same file :\r\n\r\n    'Former' =\u003e 'Former\\Facades\\Former',\r\n\r\n-----\r\n\r\n### Documentation\r\n\r\nPlease refer to the [wiki](https://github.com/formers/former/wiki) for the full documentation.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformers%2Fformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformers%2Fformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformers%2Fformer/lists"}