sakanjo/filament-reset-action

A Filament action to reset the form state.

v1.0.0 2024-05-02 19:21 UTC

This package is auto-updated.

Last update: 2024-12-21 15:03:34 UTC


README

Workflow status Laravel v11.x PHP 8.2

A Filament action to reset the form state.

✨ Help support the maintenance of this package by sponsoring me.

Preview

Table of Contents

đŸ“Ļ Install

composer require sakanjo/filament-reset-action

đŸĻ„ Usage

On the create page

<?php

namespace App\Filament\Admin\Resources\UserResource\Pages;

use App\Filament\Admin\Resources\UserResource;
use Filament\Resources\Pages\CreateRecord;
use SaKanjo\FilamentResetAction\Actions\ResetAction;

class CreateUser extends CreateRecord
{
    protected static string $resource = UserResource::class;

    protected function getHeaderActions(): array
    {
        return [
            ResetAction::make(),
        ];
    }
}

On the edit page

<?php

namespace App\Filament\Admin\Resources\UserResource\Pages;

use App\Filament\Admin\Resources\UserResource;
use App\Filament\Base\Pages\EditRecord;
use SaKanjo\FilamentResetAction\Actions\ResetAction;

class EditUser extends EditRecord
{
    protected static string $resource = UserResource::class;

    protected function getHeaderActions(): array
    {
        return [
            ResetAction::make(),
        ];
    }
}

💖 Support the development

Do you like this project? Support it by donating

Click the "💖 Sponsor" at the top of this repo.

Šī¸ Credits

📄 License

MIT License Š 2023-PRESENT Salah Kanjo