PHP code example of sakanjo / filament-reset-action
1. Go to this page and download the library: Download sakanjo/filament-reset-action library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sakanjo / filament-reset-action example snippets
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(),
];
}
}
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(),
];
}
}