Modified logic in generate template
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Successful in 19s
Laravel Larastan / larastan (pull_request) Failing after 3m6s
Laravel Pint / pint (pull_request) Failing after 3m4s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Successful in 19s
Laravel Larastan / larastan (pull_request) Failing after 3m6s
Laravel Pint / pint (pull_request) Failing after 3m4s
This commit is contained in:
@@ -17,7 +17,12 @@ $sticker_id = $attributes->get('sticker_id');
|
||||
@endif
|
||||
</div> --}}
|
||||
|
||||
@props(['sticker_id'])
|
||||
{{-- @props(['sticker_id']) --}}
|
||||
@props([
|
||||
'sticker_id',
|
||||
'plant_id',
|
||||
'item_characteristic_id',
|
||||
])
|
||||
|
||||
|
||||
{{-- @php
|
||||
@@ -29,7 +34,7 @@ $sticker_id = $attributes->get('sticker_id');
|
||||
$url = $isValid ? route('stickers.pdf', ['stickerId' => $sticker_id]) : '#';
|
||||
@endphp --}}
|
||||
|
||||
@php
|
||||
{{-- @php
|
||||
use App\Models\StickerStructureDetail;
|
||||
|
||||
$isValid = false;
|
||||
@@ -41,8 +46,32 @@ $sticker_id = $attributes->get('sticker_id');
|
||||
$url = $isValid
|
||||
? route('stickers.pdf', ['stickerId' => $sticker_id])
|
||||
: '#';
|
||||
@endphp --}}
|
||||
|
||||
@php
|
||||
use App\Models\StickerStructureDetail;
|
||||
|
||||
$hasStickerId = !empty($sticker_id) && $sticker_id != 'empty';
|
||||
|
||||
$hasPlantAndItem = !empty($plant_id) && !empty($item_characteristic_id);
|
||||
|
||||
$isValid = false;
|
||||
|
||||
if ($hasStickerId) {
|
||||
$isValid = StickerStructureDetail::where('sticker_id', $sticker_id)->exists();
|
||||
}
|
||||
|
||||
$url = $isValid
|
||||
? route('stickers.pdf', [
|
||||
'stickerId' => $sticker_id,
|
||||
// include only if present
|
||||
'plant_id' => $hasPlantAndItem ? $plant_id : null,
|
||||
'item_characteristic_id' => $hasPlantAndItem ? $item_characteristic_id : null,
|
||||
])
|
||||
: '#';
|
||||
@endphp
|
||||
|
||||
|
||||
<div class="flex flex-col items-start space-y-2">
|
||||
<a
|
||||
href="{{ $url }}"
|
||||
@@ -60,6 +89,12 @@ $sticker_id = $attributes->get('sticker_id');
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{{-- <div class="flex flex-col items-start space-y-2">
|
||||
<a
|
||||
href="{{ $url }}"
|
||||
|
||||
Reference in New Issue
Block a user