{"id":36370684,"url":"https://github.com/livecms/forms","last_synced_at":"2026-01-11T14:00:50.293Z","repository":{"id":62518058,"uuid":"141877109","full_name":"livecms/forms","owner":"livecms","description":"Laravel Forms for L5.5 or above","archived":false,"fork":false,"pushed_at":"2019-01-01T20:06:45.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-02T04:25:42.918Z","etag":null,"topics":["form","formbuilder","laravel"],"latest_commit_sha":null,"homepage":null,"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/livecms.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-22T08:02:28.000Z","updated_at":"2024-04-02T04:25:42.919Z","dependencies_parsed_at":"2022-11-02T13:45:59.172Z","dependency_job_id":null,"html_url":"https://github.com/livecms/forms","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/livecms/forms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livecms%2Fforms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livecms%2Fforms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livecms%2Fforms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livecms%2Fforms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/livecms","download_url":"https://codeload.github.com/livecms/forms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livecms%2Fforms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28306983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T11:18:18.743Z","status":"ssl_error","status_checked_at":"2026-01-11T11:07:56.842Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","formbuilder","laravel"],"created_at":"2026-01-11T14:00:22.619Z","updated_at":"2026-01-11T14:00:50.036Z","avatar_url":"https://github.com/livecms.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome to Laravel Form Component For Laravel 5.5 or above\n\n## What is ?\nThis package can make form component (ie. textbox, select, radio, checkbox) based on array of setting.\n\nBesides that, You can also create your own component consist of html and javascript.\n\n## Features\n- All benefits of LaravelCollective HTML packages\n- Create form and the components based array of settings\n- Support Jquery Validation\n- Available Components that ready to use :\n    - Textbox\n    - Telephone\n    - Number\n    - Email\n    - Password\n    - Textarea\n    - Checkbox\n    - Radio\n    - Select\n    - Select2\n    - Image\n    - Boolean (Radio button with Yes/No options)\n- Define your own component\n- Define your own validation script\n\n### Notes\n- You need add [Jquery Validation](https://jqueryvalidation.org) to use default validation properly, but you can use your own script. See [Custom Validation Section](#custom-validation).\n- Add [Select2 Files](https://select2.org/) if you want to use Select2 Component\n\n## How to use?\n\n### Install via composer\n```shell\ncomposer require livecms/forms\n```\n\n### Publish config file :\n```shell\nphp artisan vendor:publish --provider=\"LiveCMS\\Form\\FormServiceProvider\"\n```\n\nEdit 'form.php' config file.\n\n### Creating form :\n```php\n// controller\n\nuse LiveCMS\\Form\\Forms;\n\n$form = Forms::create()-\u003esetComponents([...])-\u003erender();\n\n// view\n{!! Form::open(['url' =\u003e '/your/route']) !!}\n{!! $form !!}\n{!! Form::close() !!}\n\n\u003cscript\u003e\n{!! Form::javascript()  !!}\n\u003c/script\u003e\n```\n\n### Set \u003cform\u003e\u003c/form\u003e in form :\nit has same arguments for Form::open() in [LaravelCollective HTML](https://laravelcollective.com/docs/5.2/html#opening-a-form)\n```php\n// controller\n$form = Forms::create(['url' =\u003e '/your/route', 'method' =\u003e 'PUT', 'class' =\u003e 'form-inline'])\n            -\u003esetComponents([...])\n            -\u003erender();\n\n// view\n{!! $form !!}\n\u003cscript\u003e\n{!! Form::javascript()  !!}\n\u003c/script\u003e\n```\n\n### You can create multiple forms and set a name for each form :\n```php\n// controller\nForms::create([...])-\u003esetComponents([...])-\u003esetName('form1');\nForms::create([...])-\u003esetComponents([...])-\u003esetName('form2');\n\n// view\n{!! Form::render('form1') !!}\n{!! Form::render('form2') !!}\n\n\u003cscript\u003e\n{!! Form::javascript()  !!}\n\u003c/script\u003e\n```\n\n### Available components :\nyou can see the files in folder :\n```\n/vendor/livecms/forms/src/Components\n```\n- Textbox, type : 'text'\n- Telephone, type : 'tel'\n- Number, type : 'number'\n- Email, type : 'email'\n- Password, type : 'password'\n- Textarea, type : 'textarea'\n- Checkbox, type : 'checkbox'\n- Radio, type : 'radio'\n- Select, type : 'select'\n- Select2, type : 'select2'\n- Image, type : 'image'\n- Boolean, type : 'boolean'\n\n### How to use components :\n```php\n$components = [\n    'comp1' =\u003e [\n        'type' =\u003e 'text', // required\n        'label' =\u003e null, // optional\n        'value' =\u003e null, // optional\n        'default' =\u003e null, // optioal\n        'options' =\u003e [], // optional and this only for checkbox, radio, select, select2\n        'attributes' =\u003e [], // optional\n    ],\n    ...\n    'comp-n' =\u003e [\n        'type' =\u003e 'select',\n        'options' =\u003e [\n            'one', 'two', 'three',\n        ],\n        'attributes' =\u003e [\n            'required' =\u003e true,\n            'class' =\u003e 'input-select',\n        ]\n    ]\n];\n\nForm::create([...])-\u003esetComponents($components)-\u003esetName('form1');\n```\n### Add global properties :\n```php\nForms::create([...])\n    -\u003esetComponents([...])\n    -\u003eaddGlobalProperties([\n        'required' =\u003e '*', // implemented to all components, you can use empty array []\n        'class:input-select' =\u003e ['province', 'city', 'region'],\n        'data-image:landscape' =\u003e ['image', 'cover'],\n    ])\n    -\u003esetName('form1');\n\n// the result all of defined components will get what you write in key of the array\n// example for : 'data-image:landscape' =\u003e ['image', 'cover']\n// the result  :\n/**\n * \u003cinput type=\"file\" name=\"image\" data-image=\"landscape\" /\u003e\n * \u003cinput type=\"file\" name=\"cover\" data-image=\"landscape\" /\u003e\n */\n```\n\n### Add custom component :\n- Create a Class, you can extends a class from 'LiveCMS\\Form\\Components\\BaseComponent' class in\n    ```\n    /vendor/livecms/forms/src/Components/BaseComponent.php\n    ```\n    Since it contains an abstract method render(), you have to define your own render() method.\n    You can also see the example from available components or extends from it. See all files in folder \n    ```\n    /vendor/livecms/forms/src/Components\n    ```\n- Define your custome components in 'form' config file :\n    ```\n    'components' =\u003e [\n        'text' =\u003e \\App\\Forms\\CustomeTextbox::class,\n        'image' =\u003e \\App\\Forms\\CustomeImage::class,\n    ],\n    ```\n\n### Use Validation Script\n```php\nForms::create([...])-\u003esetComponents([...])-\u003euseValidation()-\u003esetName('form1');\n```\nYou can disable validation by :\n```php\nForms::create([...])-\u003esetComponents([...])-\u003euseValidation(false)-\u003esetName('form1');\n```\n**Note** : by default, validation script require jquery validation js\n\n### Custom Validation\n- Create your own javascript file\n- Define it in 'form' config file :\n    ```php\n        'scripts' =\u003e [\n            'validation' =\u003e '/path/to/javascript/file',\n        ],\n    ```\n\n### Add custom scripts\n- Create your own javascript file\n- Define it in 'form' config file, but use other name despite 'validation' because it is reserved only for validation :\n    ```php\n        'scripts' =\u003e [\n            'validation' =\u003e '/path/to/javascript/file',\n            'customscript' =\u003e '/path/to/javascript/file',\n        ],\n    ```\n- Call it \n    ```php\n    Forms::create([...])-\u003esetComponents([...])-\u003eaddScript('customscript')-\u003esetName('form1');\n    ```\n\nIf you want to cancel adding script, fill second argument with 'false':\n```php\n-\u003eaddScript('script_name', false)\n```\n\n### Fill form with datas\n```php\n$components = [\n    'name' =\u003e ['type' =\u003e 'text'],\n    'email' =\u003e ['type' =\u003e 'email'],\n];\n$datas = ['name' =\u003e 'Mokhamad Rofiudin', 'email' =\u003e 'mokh@rofiudin.com'];\nForm::create([...])\n    -\u003esetComponents($components)\n    -\u003efill($datas)\n    -\u003esetName('form1')\n    -\u003erender();\n```\n\n## LICENSE\nMIT\n\n## CONTRIBUTING\nFork this repo and make a pull request\n\n## ISSUE AND DISCUSSION\nPlease create new issue or see the closed issues too.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivecms%2Fforms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivecms%2Fforms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivecms%2Fforms/lists"}