Download the PHP package gerenuk/filament-banhammer without Composer

On this page you can find all versions of the php package gerenuk/filament-banhammer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-banhammer

Project banner

Filament Banhammer

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads Licence

This package uses mchev/banhammer to add model banning functionality to filament.

Table of Contents

  1. Introduction
  2. Version Compatibility
  3. Installation
  4. Usage
    • Registering the Plugin
    • Ban
    • Unban
    • Ban Bulk
    • Unban Bulk
    • Authorization
    • Trashed Bans
    • IP Blocking
    • Country Blocking
  5. Testing
  6. Screenshots
    • Resource
    • Ban Action
    • Ban Bulk Action
    • Ban Modal
    • Unban Action
    • Unban Bulk Action
    • Unban Modal
  7. Changelog
  8. Contributing
  9. Security Vulnerabilities
  10. Credits
  11. License

Version Compatibility

Plugin Filament Laravel PHP
2.x 5.x 11.28|12|13 8.2|8.3|8.4
1.x 3.x 10.x 8.x
1.x 3.x 11.x 8.2|8.3

Installation

This package depends on mchev/banhammer please follow the install guide there first.

You can install the package via composer:

[!IMPORTANT] Ensure you have already installed mchev/banhammer before doing this.

This package's own migration (for the Country Blocking feature) is picked up automatically by php artisan migrate — no vendor:publish needed, unless you'd rather have the migration file alongside your own, in which case publish it with:

You can publish the config file with:

Here's an overview of the published config file (the full file is at config/filament-banhammer.php):

Usage

You first need to register the plugin with Filament. This can be done inside of your PanelProvider, e.g. AdminPanelProvider.

For each model you have added the Bannable trait to, you will also need to add the following method:

[!IMPORTANT] This specifies which property to be displayed in the bans resource.

Ban

To be able to ban a resource simply add the Ban action:

Unban

To be able to unban a resource simply add the Unban action:

A ban resource is included by default if you would prefer to use that instead. UnbanAction works whether it's placed on your own bannable resource's table (as above) or on the bundled ban resource's table, where the record is a ban itself rather than the bannable model.

Ban Bulk

To be able to bulk ban a resource simply add the BanBulk action:

Unban Bulk

To be able to bulk unban a resource simply add the UnbanBulk action:

A ban resource is included by default if you would prefer to use that instead.

Authorization

BanAction, BanBulkAction, UnbanAction, UnbanBulkAction, EditBanAction, EditBanBulkAction and BanIpAction each check a Laravel policy ability against the record they're acting on, named in the authorization config key (ban, unban, editBan and banIp by default). If the record's model has no policy, or the policy has no method by that name, the action is allowed — so nothing changes until you opt in by adding the method:

Restoring and force-deleting bans (see Trashed Bans) aren't in the authorization config — they use Filament's own restore/forceDelete resource policy conventions instead.

Trashed Bans

Bans are soft-deleted (via mchev/banhammer's Ban model), so the bundled resource ships a "trashed" filter and restore actions by default. Force-deleting a ban permanently is opt-in:

IP Blocking

The bundled resource includes a "Ban IP" header action that creates an IP-only ban with no bannable model attached, using mchev/banhammer's IP bans. Existing bans, including IP-only ones, can be edited (to correct the IP) and unbanned like any other row. Disable it with:

Country Blocking

mchev/banhammer can block requests by country, but manages the blocked list through its own blocked_countries config value. Enabling country_blocking adds a bundled resource for managing that list from the database instead, and merges it into ban.blocked_countries on every application boot:

This package's migration needs to have run first — see Installation. Note this only manages the list; you still need mchev/banhammer's own BANHAMMER_BLOCK_BY_COUNTRY env variable (or block_by_country config value) set to actually enable the country-blocking middleware.

[!NOTE] On Octane or a long-running worker, the application boots once and is reused across requests, so a change made in the blocked countries resource won't take effect until the worker restarts.

Testing

Screenshots

Resource

Ban Resource

Ban Action

Ban Action

Ban Bulk Action

Ban Bulk Action

Ban Modal

Ban Modal

Unban Action

Unban Action

Unban Bulk Action

Unban Bulk Action

Unban Modal

Unban Modal

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of filament-banhammer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^5.7
mchev/banhammer Version ^2.5
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gerenuk/filament-banhammer contains the following files

Loading the files please wait ...