feat(auth): complete registration anti-spam and quota hardening
This commit is contained in:
31
app/Models/EmailSendEvent.php
Normal file
31
app/Models/EmailSendEvent.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class EmailSendEvent extends Model
|
||||
{
|
||||
protected $table = 'email_send_events';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'type',
|
||||
'email',
|
||||
'ip',
|
||||
'user_id',
|
||||
'status',
|
||||
'reason',
|
||||
'created_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'created_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
26
app/Models/SystemEmailQuota.php
Normal file
26
app/Models/SystemEmailQuota.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SystemEmailQuota extends Model
|
||||
{
|
||||
protected $table = 'system_email_quota';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'period',
|
||||
'sent_count',
|
||||
'limit_count',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'updated_at' => 'datetime',
|
||||
'sent_count' => 'integer',
|
||||
'limit_count' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@ class User extends Authenticatable
|
||||
'onboarding_step',
|
||||
'name',
|
||||
'email',
|
||||
'last_verification_sent_at',
|
||||
'verification_send_count_24h',
|
||||
'verification_send_window_started_at',
|
||||
'is_active',
|
||||
'needs_password_reset',
|
||||
'password',
|
||||
@@ -51,6 +54,9 @@ class User extends Authenticatable
|
||||
{
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'last_verification_sent_at' => 'datetime',
|
||||
'verification_send_window_started_at' => 'datetime',
|
||||
'verification_send_count_24h' => 'integer',
|
||||
'username_changed_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
|
||||
Reference in New Issue
Block a user