ronnytorresmtz/dropdown-inline is a Laravel package for a laravel nova field..
It currently has 1 GitHub stars and 77 downloads on Packagist (latest version 1.0.10).
Install it with composer require ronnytorresmtz/dropdown-inline.
Discover more Laravel packages by ronnytorresmtz
or browse all Laravel packages to compare alternatives.
Last updated
This package allow you to edit a Dropdown field in the index page with one click
composer require ronnytorresmtz/dropdown-inline
public function fields(Request $request)
{
return [
DropdownInline::make('Start Date')
->options([
0 => 'Activo',
1 => 'No Activo',
]),
];
}
To edit the Dropdown field you need to click it on.
If you press the Esc key or lost the focues the field will became not editable.
public function fields(Request $request)
{
return [
DropdownInline::make('Start Date')
->options([
0 => 'Activo',
1 => 'No Activo',
])
->inlineOnIndex(),
];
}
public function fields(Request $request)
{
return [
DropdownInline::make('Start Date')
->options([
0 => 'Activo',
1 => 'No Activo',
])
->inlineOnIndex()
->displayUsingLabels(),
];
}
WATCH OUT: This field needs the displayUsingLabels method to be set if not the field does not work well with values.
This method also accepts a closure with the current request if you want to make it editable dynamically:
public function fields()
{
return [
DropdownInline::make('Start Date')
->options([
0 => 'Activo',
1 => 'No Activo',
])
->displayUsingLabels()
->inlineOnIndex(function (NovaRequest $request) {
return $request->user()->isAdmin();
}),
];
}