Or if you kindly can give me another solution or package to be able to change the status of a boolean from the index... like inline editing
Thanks
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Dear friends, I really need some urgent help with this:
I am trying to be able to change the Status of a resource from true to false (Boolean) from the index page in nova (without having to go into the resource page).
I used a package - nova-toggle - It works perfectly on my local computer but when I deploy, the feature of the toggle from index does not work. It gives a 404 error.
I thought this has to do with the package, but I tried another package that does the same thing in a different way and I faced the same problem. So, I thought this has to do with Nova or my server rather than with the packages.
Anyone has any tips on how to fix this?
Thanks a lot,
No 3rd party package is required for this. A better solution is to create a Nova Action. This allows you to run the action against one or multiple resource instances concurrently (including all of them you have, even if the number exceeds the pagination value). The docs are here (https://nova.laravel.com/docs/3.0/actions/defining-actions.html). An example action that sets an 'active' boolean (substitute your model property as needed):
class SetActiveStatus extends Action
{
use InteractsWithQueue, Queueable;
/**
* Perform the action on the given models.
*
* @param \Laravel\Nova\Fields\ActionFields $fields
* @param \Illuminate\Support\Collection $models
* @return mixed
*/
public function handle(ActionFields $fields, Collection $models)
{
$value = $fields->status;
foreach($models as $model)
{
$model->update([
'active' => $value
]);
}
return Action::message('The selected items have been made ' . $value == 1 ? 'active' : 'inactive' . '.');
}
/**
* Get the fields available on the action.
*
* @return array
*/
public function fields()
{
return [
Select::make('Status')
->options([
1 => 'Active',
0 => 'Inactive'
])
->rules(
'required'
)
];
}
}
The register your action in any Nova resources that you wish (optionally use canSee() to determine which users can run the action):
public function actions(Request $request)
{
return [
(new SetActiveStatus)->canSee(function ($request) {
return $request->user()->can('Set Active Status');
})
];
}
Please or to participate in this conversation.