Added logic for validation in generate temp
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Successful in 20s
Laravel Larastan / larastan (pull_request) Failing after 2m24s
Laravel Pint / pint (pull_request) Failing after 2m49s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Successful in 20s
Laravel Larastan / larastan (pull_request) Failing after 2m24s
Laravel Pint / pint (pull_request) Failing after 2m49s
This commit is contained in:
@@ -20,16 +20,47 @@ $sticker_id = $attributes->get('sticker_id');
|
|||||||
@props(['sticker_id'])
|
@props(['sticker_id'])
|
||||||
|
|
||||||
|
|
||||||
@php
|
{{-- @php
|
||||||
// $var = $sticker_id ?? 'undefined';
|
$var = $sticker_id ?? 'undefined';
|
||||||
// \Log::info('Blade Debug: sticker_id type = ' . gettype($var));
|
\Log::info('Blade Debug: sticker_id type = ' . gettype($var));
|
||||||
// \Log::info('Blade Debug: sticker_id value = ', ['value' => $var]);
|
\Log::info('Blade Debug: sticker_id value = ', ['value' => $var]);
|
||||||
|
|
||||||
$isValid = $sticker_id && $sticker_id != 'empty';
|
$isValid = $sticker_id && $sticker_id != 'empty';
|
||||||
$url = $isValid ? route('stickers.pdf', ['stickerId' => $sticker_id]) : '#';
|
$url = $isValid ? route('stickers.pdf', ['stickerId' => $sticker_id]) : '#';
|
||||||
|
@endphp --}}
|
||||||
|
|
||||||
|
@php
|
||||||
|
use App\Models\StickerStructureDetail;
|
||||||
|
|
||||||
|
$isValid = false;
|
||||||
|
|
||||||
|
if (!empty($sticker_id) && $sticker_id != 'empty') {
|
||||||
|
$isValid = StickerStructureDetail::where('sticker_id', $sticker_id)->exists();
|
||||||
|
}
|
||||||
|
|
||||||
|
$url = $isValid
|
||||||
|
? route('stickers.pdf', ['stickerId' => $sticker_id])
|
||||||
|
: '#';
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<div class="flex flex-col items-start space-y-2">
|
<div class="flex flex-col items-start space-y-2">
|
||||||
|
<a
|
||||||
|
href="{{ $url }}"
|
||||||
|
@if(!$isValid)
|
||||||
|
onclick="alert('Sticker ID not found in sticker structure details'); return false;"
|
||||||
|
@endif
|
||||||
|
target="_blank"
|
||||||
|
class="px-2 py-1 border
|
||||||
|
{{ $isValid
|
||||||
|
? 'border-success-500 text-success-600 hover:bg-success-50 hover:border-success-700'
|
||||||
|
: 'border-gray-300 text-gray-400 cursor-not-allowed' }}
|
||||||
|
rounded transition text-sm"
|
||||||
|
>
|
||||||
|
Generate Template
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- <div class="flex flex-col items-start space-y-2">
|
||||||
<a
|
<a
|
||||||
href="{{ $url }}"
|
href="{{ $url }}"
|
||||||
@if(!$isValid)
|
@if(!$isValid)
|
||||||
@@ -44,7 +75,7 @@ $sticker_id = $attributes->get('sticker_id');
|
|||||||
>
|
>
|
||||||
Generate Template
|
Generate Template
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div> --}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user