Loheide-eu-mitarbeiterplatt.../plugins-core/pages/src/Models/ContentSnippet.php
Friederich Loheide 2166a7e11a
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 5m0s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 5m0s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m50s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m33s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 6m11s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m46s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m24s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m33s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m17s
Seiten: Bausteine und Vorlagen (0.22.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 07:48:02 +00:00

35 lines
939 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace Inhaus\Plugins\Pages\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* Baustein (kind = block): ein Inhalt, der auf vielen Seiten eingebunden wird –
* Änderungen wirken überall. Vorlage (kind = template): Ausgangsinhalt für neue Seiten.
*/
#[Fillable(['kind', 'name', 'description', 'content', 'created_by', 'updated_by'])]
class ContentSnippet extends Model
{
public const BLOCK = 'block';
public const TEMPLATE = 'template';
public const KINDS = [self::BLOCK => 'Baustein', self::TEMPLATE => 'Vorlage'];
protected function casts(): array
{
return ['content' => 'array'];
}
/**
* @return BelongsTo<User, $this>
*/
public function editor(): BelongsTo
{
return $this->belongsTo(User::class, 'updated_by');
}
}