fix: add fallback value for setting variables

This commit is contained in:
idevakk
2025-11-28 05:59:25 -08:00
parent a33c0dfa95
commit d4de074161
7 changed files with 88 additions and 50 deletions

View File

@@ -20,7 +20,10 @@
<img class="min-w-full px-4 pt-4 sm:pt-6 sm:px-6 rounded-tl-4xl rounded-tr-4xl rounded-bl-3xl rounded-br-3xl" src="{{ asset('storage/'.$postDetail->post_image) }}" alt="{{ $postDetail->post }}" />
</span>
<div class="magic-box my-2 px-4 sm:px-6 min-w-full flex flex-col items-center overflow-auto">
{!! json_decode(config('app.settings.ads_settings'))->two !!}
@php
$adsSettings = json_decode(config('app.settings.ads_settings') ?: '{}');
echo $adsSettings->two ?? '';
@endphp
</div>
<div class="flex w-full items-center justify-center px-4 py-2 sm:px-6">
<flux:text>{!! $postDetail->content !!}</flux:text>

View File

@@ -7,7 +7,11 @@
<flux:heading class="mb-3" size="xl" level="1">Inbox</flux:heading>
<div class="mb-3"></div>
@foreach(array_reverse($messages) as $i => $message)
@if($i % 5 == 0 && json_decode(config('app.settings.ads_settings'))->five)
@php
$adsSettings = json_decode(config('app.settings.ads_settings') ?: '{}');
$showAdFive = $adsSettings->five ?? false;
@endphp
@if($i % 5 === 0 && $showAdFive)
@endif
<div class="inbox-list cursor-pointer" x-on:click="show = true; id = {{ $message['id'] }};" data-id="{{ $message['id'] }}">