{"id":15283906,"url":"https://github.com/nodus-it/livewire-forms","last_synced_at":"2025-04-12T23:14:19.319Z","repository":{"id":39946559,"uuid":"311639455","full_name":"nodus-it/livewire-forms","owner":"nodus-it","description":"A awesome package for easy dynamic forms with Laravel Livewire and Bootstrap v4","archived":false,"fork":false,"pushed_at":"2024-03-25T15:54:46.000Z","size":233,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T23:14:14.697Z","etag":null,"topics":["bootstrap","forms","laravel","livewire","validation"],"latest_commit_sha":null,"homepage":"","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/nodus-it.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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":"2020-11-10T11:37:04.000Z","updated_at":"2025-02-19T20:18:31.000Z","dependencies_parsed_at":"2024-02-01T14:29:46.326Z","dependency_job_id":"c42c7edb-543a-41b9-afeb-2dbe83386349","html_url":"https://github.com/nodus-it/livewire-forms","commit_stats":{"total_commits":119,"total_committers":5,"mean_commits":23.8,"dds":0.3613445378151261,"last_synced_commit":"d764399489f1254700a422790bb921a1e8e22a0e"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodus-it%2Flivewire-forms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodus-it%2Flivewire-forms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodus-it%2Flivewire-forms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodus-it%2Flivewire-forms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodus-it","download_url":"https://codeload.github.com/nodus-it/livewire-forms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643006,"owners_count":21138355,"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":["bootstrap","forms","laravel","livewire","validation"],"created_at":"2024-09-30T14:48:10.568Z","updated_at":"2025-04-12T23:14:19.294Z","avatar_url":"https://github.com/nodus-it.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Livewire Forms\n[![License](https://poser.pugx.org/nodus-it/livewire-forms/license)](https://packagist.org/packages/nodus-it/livewire-forms)\n[![Latest Stable Version](https://poser.pugx.org/nodus-it/livewire-forms/v/stable)](https://packagist.org/packages/nodus-it/livewire-forms)\n[![Total Downloads](https://poser.pugx.org/nodus-it/livewire-forms/downloads)](https://packagist.org/packages/nodus-it/livewire-forms)\n[![Unit-Tests](https://github.com/nodus-it/livewire-forms/actions/workflows/unittests.yml/badge.svg)](https://github.com/nodus-it/livewire-forms/actions/workflows/unittests.yml)\n[![codecov](https://codecov.io/gh/nodus-it/livewire-datatables/branch/master/graph/badge.svg)](https://codecov.io/gh/nodus-it/livewire-forms)\n\n_An awesome package for easy dynamic forms with **Laravel Livewire** and **Bootstrap v4**._\n\nSome special input types may require external javascript dependencies (besides Bootstrap).\n\nThe following inputs are currently supported:\n\n- Checkbox\n- Code (requires [CodeMirror.js](https://codemirror.net/))\n- Color\n- Date\n- Datetime (composed of a date and a time input)\n- Decimal/Money (own implementation with currency and custom unit support)\n- File\n- Hidden\n- Number\n- Password\n- Radio (Bootstrap radio button group)\n- RichTextarea (requires [Quill.js](https://quilljs.com/))\n- Select (requires [bootstrap-select](https://developer.snapappointments.com/bootstrap-select/))\n- Text\n- Textarea\n- Time\n- _It's also possible to create your own custom input types_...\n\n## Installation\nYou can install the package via composer:\n````\ncomposer require nodus-it/livewire-forms\n````\nInclude the JavaScript after the ``@livewireScripts`` directive on every page that will be using Livewire. \n````html\n...\n\u003cbody\u003e\n    ...\n    @livewireScripts\n    \u003cscript src=\"{{ asset( 'livewire-forms/livewire-forms.js' ) }}\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n````\n\nYou can publish the config file with:\n````\nphp artisan vendor:publish --provider=\"Nodus\\Packages\\LivewireForms\\LivewireFormsServiceProvider\" --tag=\"livewire-forms:config\"\n````\nYou can publish the blade views with:\n````\nphp artisan vendor:publish --provider=\"Nodus\\Packages\\LivewireForms\\LivewireFormsServiceProvider\" --tag=\"livewire-forms:views\"\n````\n\n## Usage\n### Minimal form view example\n````php\nclass UserForm extends FormView\n{\n    public function inputs()\n    {\n        $this-\u003eaddText('name')\n            -\u003esetValidations('required|unique:users,name')\n            -\u003esetSize(4);\n        $this-\u003eaddSelect('country')\n            -\u003esetOptions(['DE' =\u003e ['label' =\u003e 'DE']])\n            -\u003esetValidations('required')\n            -\u003esetDefaultValue('DE');\n        $this-\u003eaddInput(CustomFileUploadInput::class, 'picture')\n\n        $this-\u003eaddSection('tenants.views.contact');\n        $this-\u003eaddText('email')\n            -\u003esetValidations('required|email');\n        $this-\u003eaddText('phone')\n            -\u003esetValidations('required');\n    }\n\n    public function submitCreate(array $values)\n    {\n        User::query()-\u003ecreate($values);\n    \n        return redirect()-\u003eback();\n    }\n\n    public function submitUpdate(array $values, User $user)\n    {\n        $user-\u003eupdate($values);\n        \n        return redirect()-\u003eback();\n    }\n}\n````\n\n### View integration\nAdd your created form like any other Livewire component to your blade templates:\n````html\n\u003clivewire:user-form /\u003e\n````\n\nIn case you want to prepopulate the input fields with an existing dataset, pass the desired model or array as attribute:\n````html\n\u003clivewire:user-form :model-or-array=\"$user\" /\u003e\n````\n\nIf you need to pass some custom data inside your forms, you can do so by passing additional data as array via the \"additional-view-parameter\" attribute:\n````html\n\u003clivewire:user-form :additional-view-parameter=\"['customKey' =\u003e 'customData']\" /\u003e\n````\n\nAll the given additional parameter can then be acccess directly in your form like so:\n````php\npublic function submitCreate(array $values)\n{\n    $this-\u003ecustomKey // resolves via __get() Magic to \"customData\"\n}\n````\n\n## Roadmap/TODO\n- File input\n  - chunked upload handling (https://fly.io/laravel-bytes/multi-file-upload-livewire/)\n- All Inputs\n  - improve multiple support\n  - check if we should support more properties\n  - custom property system\n- New inputs\n  - High-level input types e.g. Phone or Email (incl. automatic validation and input mode defaults)\n  - Maybe add also support for native select inputs\n- Extensibility\n  - override default classes (class overload)\n  - external extensions (e.g. remote select)\n    - remote loading is not supported by bootstrap select\n    - maybe move to alternative select plugin package (e.g. https://github.com/orchidjs/tom-select)\n- Post Handling\n  - Validation: add support for array validation rules\n  - Improve validation exception handling if such is thrown inside the submit methods\n- Find another solution for the integration of external plugins like bootstrap-select than using \"wire:ignore\" due to several drawbacks that come with this, such as no possibility for dynamic select option updates.\n\n## Testing\n````\ncomposer test\n````\n\n## License\nThe MIT License (MIT). Please see [License File](LICENCE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodus-it%2Flivewire-forms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodus-it%2Flivewire-forms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodus-it%2Flivewire-forms/lists"}