feat(AI): add ai manager admin and create powerpoint with ai
This commit is contained in:
@@ -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>
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user