Initial baseline: LaraBlog core with plugin commerce surface.
Captures the current working tree after theme slots, ArticleAccess, and the payment / paid-content plugins so subsequent work has a reviewable git history.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Theme;
|
||||
|
||||
use App\Domain\Plugin\Hook;
|
||||
use App\Settings\SnippetSettings;
|
||||
use Throwable;
|
||||
|
||||
final class RegistersSnippetSlots
|
||||
{
|
||||
public static function boot(): void
|
||||
{
|
||||
try {
|
||||
$snippets = app(SnippetSettings::class);
|
||||
$map = $snippets->slotMap();
|
||||
} catch (Throwable) {
|
||||
// Settings group may be missing until migrations finish.
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($map as $slot => $html) {
|
||||
if (! is_string($html) || trim($html) === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$payload = $html;
|
||||
Hook::listen(ThemeSlot::event($slot), function (string $buffer) use ($payload): string {
|
||||
return $buffer.$payload;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user