feat(AI): add ai manager admin and create powerpoint with ai

This commit is contained in:
2026-07-22 08:06:48 +03:30
parent ae974c2afa
commit 4a3c109bf3
23 changed files with 743 additions and 23 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Models;
use App\Enums\TemplateKeyType;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -27,6 +28,17 @@ class TemplateKey extends Model
return $this->belongsTo(Template::class);
}
/**
* Strip any literal curly braces the admin may have copied from the pptx placeholder
* (e.g. "{Main Title}" -> "Main Title"), since braces are added automatically at match time.
*/
protected function key(): Attribute
{
return Attribute::make(
set: fn (string $value) => trim($value, "{} \t\n\r\0\x0B"),
);
}
/**
* @return array<string, string>
*/