An open API service indexing awesome lists of open source software.

https://github.com/steelants/laravel-form


https://github.com/steelants/laravel-form

Last synced: 3 months ago
JSON representation

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/)

[![Total Downloads](https://img.shields.io/packagist/dt/steelants/form.svg?style=flat-square)](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,
...
];
```

## Contributors


## 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)