".
- "
{$name}".
- "
{$fileName}".
+ $html = "
" .
+ "

" .
+ "
" .
+ "{$name}" .
+ "{$fileName}" .
'
';
return [$url => $html];
diff --git a/app/Http/Resources/EntryResource.php b/app/Http/Resources/EntryResource.php
index e674d9a..a116de1 100644
--- a/app/Http/Resources/EntryResource.php
+++ b/app/Http/Resources/EntryResource.php
@@ -25,6 +25,8 @@ class EntryResource extends JsonResource
'content' => $this->content,
'category' => $this->category->name ?? null,
'featured_image_url' => $this->getFirstMediaUrl('featured-image') ?: null,
+ 'call_to_action_text' => $this->call_to_action_text,
+ 'call_to_action_link' => $this->call_to_action_link,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index cc4822f..476e4b5 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -17,6 +17,7 @@ use Spatie\Tags\HasTags;
Entry model with rich content and media library integration
This is the main article / blog rich content model
*/
+
class Entry extends Model implements HasMedia, HasRichContent
{
use HasFactory, HasTags, InteractsWithMedia, InteractsWithRichContent;
@@ -29,7 +30,8 @@ class Entry extends Model implements HasMedia, HasRichContent
'is_featured',
'published_at',
'content',
- 'category_id',
+ 'call_to_action_link',
+ 'call_to_action_text',
];
/**
diff --git a/database/migrations/2026_01_17_162204_add-url-to-entries.php b/database/migrations/2026_01_17_162204_add-url-to-entries.php
new file mode 100644
index 0000000..f40244e
--- /dev/null
+++ b/database/migrations/2026_01_17_162204_add-url-to-entries.php
@@ -0,0 +1,29 @@
+string('call_to_action_text')->nullable()->after('title');
+ $table->string('call_to_action_link')->nullable()->after('url');
+ });
+ }
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::table('entries', function (Blueprint $table) {
+ $table->dropColumn('call_to_action_text');
+ $table->dropColumn('call_to_action_link');
+ });
+ }
+};
diff --git a/tests/Unit/EntryModelTest.php b/tests/Unit/EntryModelTest.php
index 37fa5a6..3085db9 100644
--- a/tests/Unit/EntryModelTest.php
+++ b/tests/Unit/EntryModelTest.php
@@ -11,7 +11,8 @@ it('has correct fillable attributes', function () {
'is_featured',
'published_at',
'content',
- 'category_id',
+ 'call_to_action_link',
+ 'call_to_action_text',
];
$entry = new Entry;