mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Add Domain Blocks
This commit is contained in:
parent
f22a36fe30
commit
5cea5aab3c
3 changed files with 52 additions and 1 deletions
21
app/Models/UserDomainBlock.php
Normal file
21
app/Models/UserDomainBlock.php
Normal 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');
|
||||
}
|
||||
}
|
|
@ -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' => [
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue