PHPackages                             luceos/flarum-simple-spam-tools - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. luceos/flarum-simple-spam-tools

Abandoned → [blomstra/spam-prevention](/?search=blomstra%2Fspam-prevention)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

luceos/flarum-simple-spam-tools
===============================

Provides local extenders to enact some spam prevention.

0.1.2(3y ago)4342mitPHPPHP &gt;= 8.0

Since Aug 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/luceos/flarum-simple-spam-tools)[ Packagist](https://packagist.org/packages/luceos/flarum-simple-spam-tools)[ GitHub Sponsors](https://github.com/luceos)[ Patreon](https://www.patreon.com/luceos)[ RSS](/packages/luceos-flarum-simple-spam-tools/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (5)Used By (0)

Local extenders to prevent spam
===============================

[](#local-extenders-to-prevent-spam)

This extension adds some advanced protection against spam runs on your community. This is not an extension but a bundle of local extenders. Local extenders need to be added to your `extend.php` in the root of your Flarum installation (next to `flarum` and `composer.json` you will see a file `extend.php`).

Install the extension:

```
composer require luceos/flarum-simple-spam-tools

```

Update the extension:

```
composer require luceos/flarum-simple-spam-tools

```

Make sure to confirm all local extenders still work afterwards.

Configuration
-------------

[](#configuration)

In your `extend.php` specify some settings which should speak for themselves:

```
return [
    (new \Luceos\Spam\Filter)
        // use domain name
        ->allowLinksFromDomain('luceos.com')
        // or just a full domain with protocol, only the host name is used
        ->allowLinksFromDomain('http://flarum.org')
        // even a link works, only the domain will be used
        ->allowLinksFromDomain('discuss.flarum.org/d/26095')
        // Alternatively, use an array of domains
        ->allowLinksFromDomains([
            'luceos.com',
            'flarum.org',
            'discuss.flarum.org'
        ])
        // How long after sign up all posts are scrutinized for bad content
        ->checkForUserUpToHoursSinceSignUp(5)
        // How many of the first posts of a user to scrutinize for bad content
        ->checkForUserUpToPostContribution(5)
        // Specify the user Id of the moderator raising flags for some actions
        ->moderateAsUser(2),
];
```

### Prevent Bio Spam

[](#prevent-bio-spam)

```
return [
    // ...
    new \Luceos\Spam\UserBio,
]
```

This will prevent any bad content etc based on the Filter settings from configuration.

### Prevent CommentPost Spam

[](#prevent-commentpost-spam)

```
return [
    // ..
    new \Luceos\Spam\CommentPost,
]
```

This will prevent any bad content in posts based on the Filter settings.

### Prevent Discussion Subject Spam

[](#prevent-discussion-subject-spam)

```
return [
    // ..
    new \Luceos\Spam\Discussion,
]
```

Prevents URL's in discussion subjects/titles.

### Example full configuration

[](#example-full-configuration)

This could be an example local `extend.php`:

```
