Skip to content

Commit c428bb2

Browse files
committed
Add new block config option
1 parent 5a45e41 commit c428bb2

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

app/Http/Controllers/UserController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ public function saveLink(Request $request)
243243
// Add $linkType->custom_html to the $customParams array
244244
$customParams['custom_html'] = $linkType->custom_html;
245245
}
246+
247+
// Check if $linkType->ignore_container is defined and not null
248+
if (isset($linkType->ignore_container)) {
249+
// Add $linkType->ignore_container to the $customParams array
250+
$customParams['ignore_container'] = $linkType->ignore_container;
251+
}
246252

247253
$filteredLinkData['type_params'] = json_encode($customParams);
248254

app/Models/LinkType.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class LinkType extends Model
1010
{
11-
protected $fillable = ['id', 'typename', 'title', 'description', 'icon', 'custom_html'];
11+
protected $fillable = ['id', 'typename', 'title', 'description', 'icon', 'custom_html', 'ignore_container'];
1212

1313
// Assuming no database interaction, we can disable timestamps
1414
public $timestamps = false;
@@ -32,6 +32,7 @@ public static function get()
3232
'description' => null,
3333
'icon' => 'bi bi-boxes',
3434
'custom_html' => false,
35+
'ignore_container' => false,
3536
]);
3637

3738
$linkTypes->prepend($predefinedLinkType);
@@ -48,7 +49,8 @@ public static function get()
4849
'title' => $configData['title'] ?? null,
4950
'description' => $configData['description'] ?? null,
5051
'icon' => $configData['icon'] ?? null,
51-
'custom_html' => $configData['custom_html'] ?? [],
52+
'custom_html' => $configData['custom_html'] ?? false,
53+
'ignore_container' => $configData['ignore_container'] ?? false,
5254
]);
5355
$linkTypes->push($linkType);
5456
}

0 commit comments

Comments
 (0)