*/ public function template(): BelongsTo { 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 */ protected function casts(): array { return [ 'type' => TemplateKeyType::class, 'is_required' => 'boolean', 'is_repeatable' => 'boolean', 'sort_order' => 'integer', ]; } }