> ## Documentation Index
> Fetch the complete documentation index at: https://filament-34a8cf01.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Checkbox column

> [!WARNING]
>
> You are currently viewing the documentation for Filament 4.x, which is a previous version of Filament.
>
> Looking for the current stable version? Visit the [5.x documentation](https://filament-34a8cf01.mintlify.site/5.x/tables/columns/checkbox.md).

## Introduction

The checkbox column allows you to render a checkbox inside the table, which can be used to update that database record without needing to open a new page or a modal:

```php theme={"theme":"gruvbox-dark-hard"}
use Filament\Tables\Columns\CheckboxColumn;

CheckboxColumn::make('is_admin')
```

Loading preview

![Checkbox column](https://filament-34a8cf01.mintlify.site/docs/images/4.x/light/tables/columns/checkbox/simple.jpg)

## Lifecycle hooks

Hooks may be used to execute code at various points within the checkbox's lifecycle:

```php theme={"theme":"gruvbox-dark-hard"}
CheckboxColumn::make()
    ->beforeStateUpdated(function ($record, $state) {
        // Runs before the state is saved to the database.
    })
    ->afterStateUpdated(function ($record, $state) {
        // Runs after the state is saved to the database.
    })
```

## Security

### Authorization

Checkbox columns do not automatically check model policies. Without an authorization check, users can update the column for records accessible through the table query, even if the record's `update()` policy denies access to its edit page. Use `disabled()` with your authorization logic, for example `disabled(fn ($record) => $record->user_id !== auth()->id())`. Filament checks this condition on the server before saving.

Check permission for the specific attribute being changed, especially sensitive attributes such as administrator access. If the column updates a related model or pivot, authorize that operation too. Alternatively, use a resource edit page or a policy-backed `EditAction` to apply the resource's edit authorization.

[Edit this page on GitHub](https://github.com/filamentphp/filament/edit/4.x/packages/tables/docs/02-columns/09-checkbox.md)

## Sponsored by

[Your logo here](https://github.com/sponsors/danharrin)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.