Add Domain Blocks

This commit is contained in:
Daniel Supernault 2023-12-16 04:56:22 -07:00
parent f22a36fe30
commit 5cea5aab3c
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1
3 changed files with 52 additions and 1 deletions

View file

@ -0,0 +1,21 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Profile;
class UserDomainBlock extends Model
{
use HasFactory;
protected $guarded = [];
public $timestamps = false;
public function profile()
{
return $this->belongsTo(Profile::class, 'profile_id');
}
}

View file

@ -110,7 +110,8 @@ return [
'user_filters' => [
'max_user_blocks' => env('PF_MAX_USER_BLOCKS', 50),
'max_user_mutes' => env('PF_MAX_USER_MUTES', 50)
'max_user_mutes' => env('PF_MAX_USER_MUTES', 50),
'max_domain_blocks' => env('PF_MAX_DOMAIN_BLOCKS', 50),
],
'reports' => [

View file

@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('user_domain_blocks', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('profile_id')->index();
$table->string('domain');
$table->unique(['profile_id', 'domain'], 'user_domain_blocks_by_id');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('user_domain_blocks');
}
};