Add External URL Field to Product Schema and Localization: Introduced an 'external_url' field in the ProductForm for enhanced product management. Updated the Product model to include this new field and created a migration to add it to the products table. Enhanced localization support by adding relevant translations in both English and Turkish language files. Updated the menu-item Blade component to utilize the external URL, allowing links to open in a new tab if provided, improving user experience.
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
<ul class="pl-0 list-none">
|
||||
@foreach($services as $service)
|
||||
<li class="w-full">
|
||||
<a class='dropdown-item hover:!text-[#e31e24] !pl-0 !bg-transparent' href="{{ route('products.show', $service->slug) }}">{{ $service->translate('title') }}</a>
|
||||
<a class='dropdown-item hover:!text-[#e31e24] !pl-0 !bg-transparent' href="{{ $service->external_url ? $service->external_url : route('products.show', $service->slug) }}" @if($service->external_url) target="_blank" @endif>{{ $service->translate('title') }}</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@@ -47,7 +47,8 @@
|
||||
@foreach($featuredProducts as $item)
|
||||
<div class="flex-none " style="width: 183px;">
|
||||
<a class="group !bg-transparent !p-0 block transition-transform duration-300 hover:-translate-y-1"
|
||||
href="{{ route('products.show', $item->slug) }}"
|
||||
href="{{ $item->external_url ? $item->external_url : route('products.show', $item->slug) }}"
|
||||
@if($item->external_url) target="_blank" @endif
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ $item->translate('title') }}">
|
||||
|
||||
Reference in New Issue
Block a user