Migration complete

This commit is contained in:
2026-06-23 19:24:38 +02:00
parent 279160c1cb
commit 64b26ef059
126 changed files with 8121 additions and 221 deletions

View File

@@ -4,10 +4,12 @@ namespace App\Models;
use App\Helpers\EntryHelpers;
use App\Traits\HasGallery;
use App\Traits\HasXenforoUserId;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use League\CommonMark\GithubFlavoredMarkdownConverter;
/**
* @property int $id
@@ -59,7 +61,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class News extends Model
{
use SoftDeletes, HasGallery;
use SoftDeletes, HasGallery, HasXenforoUserId;
protected $table = 'news';
@@ -108,6 +110,16 @@ class News extends Model
return $this->belongsTo(Category::class);
}
public function getDescriptionHtmlAttribute(): string
{
$converter = new GithubFlavoredMarkdownConverter([
'html_input' => 'strip',
'allow_unsafe_links' => false,
]);
return $converter->convert($this->description)->getContent();
}
public function getYoutubeVideoId(): ?string {
if( !$this->youtube_link )
return null;