diff --git a/app/Models/AutospamCustomTokens.php b/app/Models/AutospamCustomTokens.php new file mode 100644 index 000000000..874f41411 --- /dev/null +++ b/app/Models/AutospamCustomTokens.php @@ -0,0 +1,11 @@ + env('PF_BOUNCER_ENABLED', false), + + + /* + |-------------------------------------------------------------------------- + | Ignored Tokens + |-------------------------------------------------------------------------- + | + | Ignored tokens are for commonly used words that may impact the detection. + | These tokens should be lowercase and not contain spaces or non alpha- + | numerical characters and be in comma-separated format. + | + */ + + 'ignored_tokens' => env('PF_AUTOSPAM_IGNORED_TOKENS', 'the,a,of,and'), + + 'nlp' => [ + 'enabled' => false, + 'spam_sample_limit' => env('PF_AUTOSPAM_NLP_SPAM_SAMPLE_LIMIT', 200), + ] +]; diff --git a/database/migrations/2023_05_15_050604_create_autospam_custom_tokens_table.php b/database/migrations/2023_05_15_050604_create_autospam_custom_tokens_table.php new file mode 100644 index 000000000..e2f7f7e66 --- /dev/null +++ b/database/migrations/2023_05_15_050604_create_autospam_custom_tokens_table.php @@ -0,0 +1,34 @@ +bigIncrements('id'); + $table->string('token')->index(); + $table->integer('weight')->default(1)->index(); + $table->boolean('is_spam')->default(true)->index(); + $table->text('note')->nullable(); + $table->string('category')->nullable()->index(); + $table->boolean('active')->default(false)->index(); + $table->unique(['token', 'category']); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('autospam_custom_tokens'); + } +};