https://github.com/64robots/nova-row
Row Field for Laravel Nova
https://github.com/64robots/nova-row
Last synced: 5 months ago
JSON representation
Row Field for Laravel Nova
- Host: GitHub
- URL: https://github.com/64robots/nova-row
- Owner: 64robots
- Archived: true
- Created: 2018-09-10T14:20:05.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-29T08:02:59.000Z (over 7 years ago)
- Last Synced: 2025-11-12T10:28:22.090Z (7 months ago)
- Language: Vue
- Homepage:
- Size: 194 KB
- Stars: 17
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Important
# This field has been merged to [Custom Nova Fields](https://github.com/64robots/nova-fields) package. Keep track of it for updates!
# Row Field for Laravel Nova
This field allows you to create horizontal rows passing a collection of [Custom Nova Fields](https://github.com/64robots/nova-fields).
### Demo

### Install
Run this command in your nova project:
`composer require 64robots/nova-fields`
### Add it to your Nova Resource:
Create a new Row field passing an array of Nova Fields as a second param. Attribute name can be passed as third param.
As we are using [R64 Nova Fields](https://github.com/64robots/nova-fields). We can customize the classes and hide the field labels.
```php
use R64\NovaFields\Row;
Row::make('Lines', [
Number::make('Quantity')
->fieldClasses('w-full px-8 py-6')
->hideLabelInForms(),
Text::make('Product')
->fieldClasses('w-full px-8 py-6')
->hideLabelInForms(),
Number::make('Price')
->fieldClasses('w-full px-8 py-6')
->hideLabelInForms(),
])->fieldClasses('w-full px-8 py-6')
->labelClasses('w-1/2 px-8 py-6'),
```
This converts to an array of objects.
```javascript
[
{ quantity: 1, product: 'This One', price: 20 },
{ quantity: 2, product: 'That One', price: 21 }
];
```
### Localization
Set your translations in the corresponding xx.json file located in `/resources/lang/vendor/nova`
```php
...
"Add Row": "Añadir Fila",
"Delete Row": "Eliminar Fila",
"Are you sure you want to delete this row?": "¿Estás seguro de querer eliminar esta fila?"
```