PHPackages                             okeonline/filament-archivable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. okeonline/filament-archivable

ActiveLibrary[Database &amp; ORM](/categories/database)

okeonline/filament-archivable
=============================

A filament plugin to use archivable models

v1.2.0(1y ago)208.1k11[4 PRs](https://github.com/okeonline/filament-archivable/pulls)MITPHPPHP ^8.3CI passing

Since Jul 10Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/okeonline/filament-archivable)[ Packagist](https://packagist.org/packages/okeonline/filament-archivable)[ Docs](https://github.com/okeonline/filament-archivable)[ GitHub Sponsors]()[ RSS](/packages/okeonline-filament-archivable/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (15)Versions (9)Used By (0)

[![Filament Archivable](https://github.com/okeonline/filament-archivable/raw/main/assets/screen-header.png)](https://github.com/okeonline/filament-archivable/raw/main/assets/screen-header.png)

Filament plugin to archive, unarchive and filter records
========================================================

[](#filament-plugin-to-archive-unarchive-and-filter-records)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fc7b15f2385db424c6a623dadf0ef949446b746787510b6428a9d8940060f9e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6b656f6e6c696e652f66696c616d656e742d61726368697661626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/okeonline/filament-archivable)[![GitHub Tests Action Status](https://camo.githubusercontent.com/7121db9736e70b887ef8dce7daaec0fe16b0b023aabb98a4610730250f11dbe9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f6b656f6e6c696e652f66696c616d656e742d61726368697661626c652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/okeonline/filament-archivable/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/f9cf7c02e2279635fd187c8d8e78176d421cd1e2d7ba725e95c80a8f67921a46/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f6b656f6e6c696e652f66696c616d656e742d61726368697661626c652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/okeonline/filament-archivable/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/87c1e8a4faab638553a4d86f44bff39023b36f3c1c17cfb63a34948b3c2e12ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6b656f6e6c696e652f66696c616d656e742d61726368697661626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/okeonline/filament-archivable)

Filament plugin for archiving and unarchiving table records (eloquent models) based on the [Laravel Archivable package by Joe Butcher](https://github.com/joelbutcher/laravel-archivable).

This filament plugin adds an [ArchiveAction](#archiveunarchive-actions), an [UnArchiveAction](#archiveunarchive-actions) and a [ArchivedFilter](#filtering) to your resource tables. It's also possible to [add custom row-classes for archived records](#add-custom-classes-to-archived-rows). In addition to table-actions, the package provides also page-actions for view/edit pages to archive and unarchive your records.

Requirements
------------

[](#requirements)

- PHP ^8.3
- Laravel ^11.0
- Filament ^3.0
- Laravel Archivable ^1.4 (installed with this plugin)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require okeonline/filament-archivable
```

Then, add the plugin to the `AppPanelProvider`:

```
class AppPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            // ...
            ->plugin(\Okeonline\FilamentArchivable\FilamentArchivablePlugin::make());
    }
}
```

This filament plugin automatically installs the [Laravel Archivable package by Joe Butcher](https://github.com/joelbutcher/laravel-archivable).

Follow his installation instructions, which -in short- instructs:

1. Add a `archived_at` column to your table
2. Use the `Archivable`-trait on your model

Usage
-----

[](#usage)

### Archive and UnArchive table actions

[](#archive-and-unarchive-table-actions)

As soon as the `Archivable`-trait from the [Laravel Archivable package](#installation) is added to the model, it is possible to add the following actions to the corresponding resource table:

```
use Okeonline\FilamentArchivable\Tables\Actions\ArchiveAction;
use Okeonline\FilamentArchivable\Tables\Actions\UnArchiveAction;
// ...

class UserResource extends Resource
{
    // ...
    public static function table(Table $table): Table
    {
        return $table
            // ...
            ->actions([
                ArchiveAction::make(),
                UnArchiveAction::make(),
            ]);
    }
}
```

It will show the `ArchiveAction` on records that aren't archived, and will show the `UnArchiveAction` on those which are currently archived:

[![Actions](https://github.com/okeonline/filament-archivable/raw/main/assets/screen-actions.png)](https://github.com/okeonline/filament-archivable/raw/main/assets/screen-actions.png)

> You should add **both** actions to the same table. The action itself wil determine if it should be shown on the record.

The actions are normal **table** actions, similar to the [Delete](https://filamentphp.com/docs/3.x/actions/prebuilt-actions/delete) and [Restore](https://filamentphp.com/docs/3.x/actions/prebuilt-actions/restore) table actions of FilamentPHP. You can add all features that are described in the [FilamentPHP Table Actions Documentation](https://filamentphp.com/docs/3.x/tables/actions), like:

- `hiddenLabel()`
- `tooltip()`
- `disabled()`
- `icon()`
- ... etc.

```
ArchiveAction::make()
    ->hiddenLabel()
    ->tooltip('Archive'),
```

The table actions call the `$model->archive()` and `$model->unArchive()` methods that are provided by the [Laravel Achivable package](https://github.com/joelbutcher/laravel-archivable?tab=readme-ov-file#extensions).

### Archive and UnArchive page actions

[](#archive-and-unarchive-page-actions)

As soon as the `Archivable`-trait from the [Laravel Archivable package](#installation) is added to the model, it is possible to add the following actions to the resource **pages**:

```
// in e.g. Filament/PostResource/EditPage.php
use Okeonline\FilamentArchivable\Actions\ArchiveAction;
use Okeonline\FilamentArchivable\Actions\UnArchiveAction;

// ...
protected function getHeaderActions(): array
{
    return [
        ArchiveAction::make(),
        UnArchiveAction::make(),
    ];
}
```

It will show the `ArchiveAction` on records that aren't archived, and will show the `UnArchiveAction` on those which are currently archived:

> Be aware that there is a difference between **table** actions and **normal (page)** actions. You can not use the page actions as a table action, vice versa. Nevertheless, the business-logic is the same. *Read [this page](https://filamentphp.com/docs/3.x/actions/overview) for more information about the difference.*

> You should add **both** actions to the same page. The action itself wil determine if it should be shown on the record. Check [this](#add-custom-classes-to-archived-rows) if you want to edit (and unarchive) records that are being archived.

The actions are normal actions, similar to the [Delete](https://filamentphp.com/docs/3.x/actions/prebuilt-actions/delete) and [Restore](https://filamentphp.com/docs/3.x/actions/prebuilt-actions/restore) actions of FilamentPHP. You can add all features that are described in the [FilamentPHP Actions Documentation](https://filamentphp.com/docs/3.x/actions/overview), like:

- `color()`
- `size()`
- `disabled()`
- `icon()`
- ... etc.

```
use Filament\Support\Enums\ActionSize;

ArchiveAction::make()
    ->color('success')
    ->size(ActionSize::Large),
```

### Filtering

[](#filtering)

It is also possible to add a `ArchivedFilter` to the resoucre table, which adds three filtering options:

- Show only unarchived records
- Show only archived records
- Show both

> By default, an unfiltered table will only show the unarchived records, as the Laravel Archivable package comes with a default global scope to query records with `archived_at IS NULL`

You can add the filter by adding `ArchivedFilter` to your array of resource table filters:

```
use Okeonline\FilamentArchivable\Tables\Filters\ArchivedFilter;

public static function table(Table $table): Table
{
    return $table
        // ...
        ->filters([
            ArchivedFilter::make(),
        ]);
}
```

[![Filters](https://github.com/okeonline/filament-archivable/raw/main/assets/screen-filters.png)](https://github.com/okeonline/filament-archivable/raw/main/assets/screen-filters.png)

The `ArchivedFilter` will respect all options that Tenary Filters have, so check the [Tenary Filter Documentation of Filament](https://filamentphp.com/docs/3.x/tables/filters/ternary) to customize the filter.

#### Ability to view/edit/delete archived records

[](#ability-to-vieweditdelete-archived-records)

If you want to be able to view/edit/delete archived records, you should disable the global `ArchivedScope::class` on your resource ` getEloquentQuery()` method:

```
// in your resource:
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use LaravelArchivable\Scopes\ArchivableScope;

public static function getEloquentQuery(): Builder
{
    return parent::getEloquentQuery()
        ->withoutGlobalScopes([
            SoftDeletingScope::class, // only if soft deleting is also active, otherwise it can be ommitted
            ArchivableScope::class,
        ]);
}
```

See [Disabeling global scopes on Filament](https://filamentphp.com/docs/3.x/panels/resources/getting-started#disabling-global-scopes) for more information about the default resource query.

### Add custom classes to archived rows

[](#add-custom-classes-to-archived-rows)

This plugin comes with a `Table::macro` which allows you to add custom (CSS/Tailwind) classes to ***table-rows** that are archived*:

Just add the method `->archivedRecordClasses()` to your table with archived results.

```
public static function table(Table $table): Table
{
    return $table
        ->archivedRecordClasses(['opacity-25']);
}
```

[![Custom classes](https://github.com/okeonline/filament-archivable/raw/main/assets/screen-classes.png)](https://github.com/okeonline/filament-archivable/raw/main/assets/screen-classes.png)

Supported languages
-------------------

[](#supported-languages)

- en - English
- fr - French
- de - German
- nl - Dutch

You can publish and change the language files by running:

```
php artisan vendor:publish --tag=filament-archivable-translations
```

Testing
-------

[](#testing)

Minimal dev-requirement:

- filament/tables ^3.2.57

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Rudi van Zandwijk](https://github.com/rvzug)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance61

Regular maintenance activity

Popularity35

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~31 days

Recently: every ~39 days

Total

6

Last Release

509d ago

Major Versions

v0.0.2 → v1.0.02024-07-12

PHP version history (2 changes)v0.0.1PHP ^8.2

v1.0.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/167979169?v=4)[OKE Online B.V.](/maintainers/okeonline)[@okeonline](https://github.com/okeonline)

---

Top Contributors

[![rvzug](https://avatars.githubusercontent.com/u/7152234?v=4)](https://github.com/rvzug "rvzug (40 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")[![olivsinz](https://avatars.githubusercontent.com/u/29924640?v=4)](https://github.com/olivsinz "olivsinz (3 commits)")[![krekas](https://avatars.githubusercontent.com/u/11015977?v=4)](https://github.com/krekas "krekas (2 commits)")[![dissto](https://avatars.githubusercontent.com/u/11778632?v=4)](https://github.com/dissto "dissto (1 commits)")

---

Tags

archivingbuild-in-publiceloquentfilamentfilament-pluginfilament-pluginslaravellaraveleloquentfilamentfilamentphpfilament-pluginslaravel-eloquentOKE Onlinefilament-archivable

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/okeonline-filament-archivable/health.svg)

```
[![Health](https://phpackages.com/badges/okeonline-filament-archivable/health.svg)](https://phpackages.com/packages/okeonline-filament-archivable)
```

###  Alternatives

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[relaticle/custom-fields

User Defined Custom Fields for Laravel Filament

15828.6k](/packages/relaticle-custom-fields)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
