jorgv/nova-plus-button is a Laravel package for a laravel nova field..
It currently has 6 GitHub stars and 706 downloads on Packagist (latest version 0.6.4).
Install it with composer require jorgv/nova-plus-button.
Discover more Laravel packages by jorgv
or browse all Laravel packages to compare alternatives.
Last updated
This package contains a Nova field to add increment button to the index view. This is my first Nova package if you have any suggestion or improvement please let me know, I am certeain there can be better approaches.
This field was made in order to add votes and other numeric values from the index view in a quick way

This field requires an increment method within your controller and a route like this: /api/resour-name/increment/{id}.
Install this package in your Laravel app via composer:
composer require jorgv/nova-plus-button
You can use this field in your forms as default number input and in your index view as a button. You can pass the increaseValue as parameter, by default increases by 1.
\\ use Jorgv\PlusButton\PlusButton;
public function fields()
{
return [
PlusButton::make('count')->increaseValue(5),
];
}
Suggested Method in controller
class YourController extends Controller
{
public function increment(Request $request, $id)
{
if (request()->expectsJson()) {
$object = Class::find($id);
$object->count = $request->count;
$object->save();
return $object;
}
}
}
Suggested Route
Route::post('class/increase/{id}', 'YourController@increment');
The MIT License (MIT).