🚀 Hostinger Optimized
🖥️ Server: LiteSpeed
💻 System: Linux s20058.bom1.stableserver.net 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
👤 User: skhata (1324)
🐘 PHP: 8.4.20
🚫 Disabled: ✨ NONE

💻 Terminal

📁 /home/skhata/chandrasons.com/public
$

📄 ProductController.php

📁 Path: /home/skhata/chandrasons.com/app/Http/Controllers/ProductController.php
📊 Size: 1.11 KB
🔒 Perm: 0644
📝 MIME: text/x-php
<?php
namespace App\Http\Controllers;
use App\Models\ProductCategory;
use App\Models\Product;
use Artesaos\SEOTools\Facades\SEOTools;

class ProductController extends Controller {
    public function index(string $lang) {
        SEOTools::setTitle('Our Products | Chandra & Sons Pharma');
        SEOTools::setDescription('Browse our complete range of branded medicines, generic medicines, surgical supplies, and OTC wellness products.');
        return view('pages.products.index', ['lang' => $lang, 'categories' => ProductCategory::active()->get()]);
    }

    public function category(string $lang, string $slug) {
        $category = ProductCategory::where('slug', $slug)->where('is_active', true)->firstOrFail();
        $products = Product::where('category_id', $category->id)->where('is_active', true)->paginate(24);
        SEOTools::setTitle($category->getTranslation('name', $lang) . ' | Chandra & Sons Pharma');
        SEOTools::setDescription($category->getTranslation('description', $lang));
        return view('pages.products.category', ['lang' => $lang, 'category' => $category, 'products' => $products]);
    }
}
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨