diff --git a/app/Filament/Admin/Resources/Products/Schemas/ProductForm.php b/app/Filament/Admin/Resources/Products/Schemas/ProductForm.php index 5ceeb1c..219158c 100644 --- a/app/Filament/Admin/Resources/Products/Schemas/ProductForm.php +++ b/app/Filament/Admin/Resources/Products/Schemas/ProductForm.php @@ -61,6 +61,10 @@ class ProductForm ->label(__('products.view_template')) ->placeholder(__('products.view_template_placeholder')) ->helperText(__('products.view_template_helper')), + TextInput::make('external_url') + ->label(__('products.external_url')) + ->url() + ->helperText(__('products.external_url_helper')), TextInput::make('sort_order') ->label(__('products.sort_order')) ->numeric() diff --git a/app/Models/Product.php b/app/Models/Product.php index e6a1ed8..ffdb4e4 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -19,6 +19,7 @@ class Product extends Model 'hero_image', 'content', 'view_template', + 'external_url', 'sort_order', 'is_active', 'landing_page_data', diff --git a/database/migrations/2026_01_06_173049_add_external_url_to_products_table.php b/database/migrations/2026_01_06_173049_add_external_url_to_products_table.php new file mode 100644 index 0000000..44cf0b4 --- /dev/null +++ b/database/migrations/2026_01_06_173049_add_external_url_to_products_table.php @@ -0,0 +1,28 @@ +string('external_url')->nullable()->after('view_template'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('products', function (Blueprint $table) { + $table->dropColumn('external_url'); + }); + } +}; diff --git a/lang/en/products.php b/lang/en/products.php index 715ed27..635521c 100644 --- a/lang/en/products.php +++ b/lang/en/products.php @@ -17,6 +17,8 @@ return [ 'view_template' => 'Custom View Path', 'view_template_placeholder' => 'e.g. front.products.custom-page', 'view_template_helper' => 'Leave empty to use the default landing page.', + 'external_url' => 'External URL', + 'external_url_helper' => 'If filled, the menu link will open this URL in a new tab.', 'sort_order' => 'Sort Order', 'is_active' => 'Active', 'translations_section' => 'Translations', diff --git a/lang/tr/products.php b/lang/tr/products.php index c004e19..b1a3e45 100644 --- a/lang/tr/products.php +++ b/lang/tr/products.php @@ -17,6 +17,8 @@ return [ 'view_template' => 'Özel Görünüm Yolu', 'view_template_placeholder' => 'örn: front.products.ozel-sayfa', 'view_template_helper' => 'Varsayılan şablonu kullanmak için boş bırakın.', + 'external_url' => 'Harici URL', + 'external_url_helper' => 'Eğer dolu ise, menüde bu linke yeni sekmede gidilir.', 'sort_order' => 'Sıralama', 'is_active' => 'Aktif', 'translations_section' => 'Çeviriler', diff --git a/resources/views/components/front/menu-item.blade.php b/resources/views/components/front/menu-item.blade.php index 7d8322a..9cb97b4 100644 --- a/resources/views/components/front/menu-item.blade.php +++ b/resources/views/components/front/menu-item.blade.php @@ -34,7 +34,7 @@