https://github.com/steelants/laravel-form
https://github.com/steelants/laravel-form
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/steelants/laravel-form
- Owner: steelants
- License: mit
- Created: 2023-09-20T12:38:44.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-09T09:12:18.000Z (4 months ago)
- Last Synced: 2025-03-09T09:32:11.430Z (4 months ago)
- Language: Blade
- Size: 41 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Form
Livewire compatible form elements. Styled with Bootstrap 5.
## Currently WIP
### Created by: [SteelAnts s.r.o.](https://www.steelants.cz/)
[](https://packagist.org/packages/steelants/form)
## Installation
```bash
npm|pnpm|bun i quill quill-table-ui quill-mention
```### Include scripts
app.js
```js
import './quill';
```app.scss
```scss
import "./quill";
```## Examples
### Form
Attributes:
- action
- method
```blade...
...
```
Automatically inserts _method and _token base on method attribute
```html
......
```
### Input
Attributes:
- name - Input name (required for non-livewire use)
- label - Input label (optional)
- help - Help text
- group-class - Class of wrapping element
- value - value```blade
```
### Select
Attributes:
- name - Input name (required for non-livewire use)
- label - Input label (optional)
- help - Help text
- group-class - Class of wrapping element
- options - Array of values
- value - Selected value (for non-livewire use)
- placeholder - Placeholder (hidden option withou value)
- value - value```blade
@php
$options = [
1 => 'one',
2 => 'two',
3 => 'three',
];
@endphp```
### Textarea
Attributes:
- name - Input name (required for non-livewire use)
- label - Input label (optional)
- help - Help text
- group-class - Class of wrapping element
- value - value```blade
```
### Quill
- name - Input name (required for non-livewire use)
- label - Input label (optional)
- help - Help text
- group-class - Class of wrapping element
- mentions - Users for @ mentions. (see quill-mention package for more info)
- tags - Hashtags (see quill-mention package for more info)```blade
```
### Button
```blade
submit
```## Notes
- Non-livewire elment require `name` attribute
- Livewire element require `wire:model*` attribute.
- Values are inserted with `old()`
- All attributes are passed down to input/select/texarea element.## Development
1. Create subfolder `/packages` at root of your laravel project
2. clone repository to sub folder `/packages` (you need to be positioned at root of your laravel project in your terminal)
```bash
git clone https://github.com/steelants/Laravel-Form.git ./packages/Laravel-Form
```3. edit composer.json file
```json
"autoload": {
"psr-4": {
"SteelAnts\\Form\\": "packages/Laravel-Form/src/",
}
}
```4. Add provider to `bootstrap/providers.php`
```php
return [
...
SteelAnts\Form\FormServiceProvider ::class,
...
];
```## Other Packages
[steelants/laravel-auth](https://github.com/steelants/laravel-auth)[steelants/laravel-boilerplate](https://github.com/steelants/Laravel-Boilerplate)
[steelants/datatable](https://github.com/steelants/Livewire-DataTable)
[steelants/form](https://github.com/steelants/Laravel-Form)
[steelants/modal](https://github.com/steelants/Livewire-Modal)
[steelants/laravel-tenant](https://github.com/steelants/Laravel-Tenant)