feat(validation): centralize validation patterns for names and descriptions
- Introduced `ValidationPatterns` class to standardize validation rules and messages for name and description fields across the application. - Updated various components and models to utilize the new validation patterns, ensuring consistent sanitization and validation logic. - Replaced the `HasSafeNameAttribute` trait with `HasSafeStringAttribute` to enhance attribute handling and maintain consistency in name sanitization. - Enhanced the `CleanupNames` command to align with the new validation rules, allowing for a broader range of valid characters in names.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Traits\HasSafeNameAttribute;
|
||||
use App\Traits\HasSafeStringAttribute;
|
||||
use DanHarrin\LivewireRateLimiting\WithRateLimiting;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
@@ -28,7 +28,7 @@ use phpseclib3\Crypt\PublicKeyLoader;
|
||||
)]
|
||||
class PrivateKey extends BaseModel
|
||||
{
|
||||
use HasSafeNameAttribute, WithRateLimiting;
|
||||
use HasSafeStringAttribute, WithRateLimiting;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
|
||||
Reference in New Issue
Block a user