https://github.com/ferdiunal/nova-editable-field
This Laravel Nova Field enables easy record updates within tables. It’s simple to use and works seamlessly with form fields and BelongsTo fields.
https://github.com/ferdiunal/nova-editable-field
editable-table laravel laravel-nova laravel-nova-field php
Last synced: about 1 year ago
JSON representation
This Laravel Nova Field enables easy record updates within tables. It’s simple to use and works seamlessly with form fields and BelongsTo fields.
- Host: GitHub
- URL: https://github.com/ferdiunal/nova-editable-field
- Owner: ferdiunal
- License: mit
- Created: 2024-09-10T10:04:19.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-16T18:12:35.000Z (almost 2 years ago)
- Last Synced: 2025-04-03T12:14:52.003Z (about 1 year ago)
- Topics: editable-table, laravel, laravel-nova, laravel-nova-field, php
- Language: Vue
- Homepage: https://ferdiunal.tech
- Size: 1.95 MB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Nova Editable Field
The purpose of this Laravel Nova Field is to allow easy updates to records within tables (development and testing for the Detail view are still in progress). So far, I haven't tested it with third-party components. It's very easy to use and can be seamlessly integrated with form fields and BelongsTo fields.
## Installation
```bash
composer require ferdiunal/nova-editable-field
```
## Usage
It is very easy to use, the first parameter is NovaRequest, the second one allows us to dynamically change the width of the Popover.
```php
*/
public static $model = \App\Models\User::class;
/**
* The single value that should be used to represent the resource when being displayed.
*
* @var string
*/
public static $title = 'name';
/**
* The columns that should be searched.
*
* @var array
*/
public static $search = [
'id', 'name', 'email',
];
/**
* Get the fields displayed by the resource.
*
* @return array
*/
public function fields(NovaRequest $request)
{
return [
ID::make()->sortable()->hideFromIndex(),
Gravatar::make()->maxWidth(50),
Text::make('Name')
->sortable()
->maxlength(255)
->enforceMaxlength()
->rules('required', 'max:255')
->editable($request, '300px'),
Email::make('Email')
->sortable()
->rules('required', 'email', 'max:254')
->maxlength(254)
->enforceMaxlength()
->creationRules('unique:users,email')
->updateRules('unique:users,email,{{resourceId}}')
->editable($request),
];
}
}
```
## Screenshots

License This package is open-sourced software licensed under the [MIT license](LICENSE).