# CLAUDE.md — Chandra & Sons Website (chandrasons.com) ## Laravel 11 + Filament PHP 3 | Master Build Log > **READ THIS FIRST every session.** It is the single source of truth for project state, all decisions made, bugs fixed, and what to do next. --- ## Project Identity | Field | Value | |---|---| | Business | Chandra & Sons Pharma Distributors | | Domain | chandrasons.com (primary) | | Redirect | chandraandsons.in → 301 → chandrasons.com | | Location | Tampu Stand, Near New Office, Sonauli Border, Maharajganj, UP | | Phone India 1 | +91-9076742501 | | Phone India 2 | +91-9695322501 | | Phone Nepal | +977-9700696025 | | Email 1 | chandraandsonssurgical@gmail.com | | Email 2 | info@chandrasons.com | | WhatsApp | +91-9695322501 | | Facebook | https://www.facebook.com/profile.php?id=61585314057898 | | Instagram | https://www.instagram.com/andsons.c/ | | TikTok | https://www.tiktok.com/@chandraandsons2 | | Admin URL | http://localhost:8000/admin | | Admin Login | admin@chandrasons.com / Admin@1234 | --- ## Technology Stack | Layer | Technology | |---|---| | Backend | PHP Laravel 11 (PHP 8.2+) | | Admin / CMS | Filament PHP v3.2 | | Multilingual | spatie/laravel-translatable | | Frontend | Laravel Blade + Alpine.js + Tailwind CSS v3 | | Build | Vite + PostCSS | | Database | MySQL 8.0 | | SEO | artesaos/seotools | | Image | intervention/image v3 | | Cache | File driver (CACHE_STORE=file) | | Queue | Database driver | | Mail | log driver (local) → SMTP (production) | | Hosting target | Shared hosting / cPanel | **Workspace root:** `/Users/bhagwandas/Documents/Claude/Chandra-sons/chandrasons/` --- ## Design System (Session 2 — finalised) **Style:** Modern Minimal — clean whitespace, bold typography, subtle gradients, glassmorphism **Colour tokens (in `resources/css/app.css` as CSS variables):** ``` --primary: #0D7B8A deep teal --primary-dark: #095E6B --primary-light: #EBF7F9 --accent: #F4A922 amber (CTAs) --accent-dark: #D4890A --success: #22C55E --dark: #0B1F2B near-black navy --text: #1E293B --text-muted: #64748B --bg: #F8FAFC --border: #E2E8F0 --white: #FFFFFF ``` **Font:** Inter (Google Fonts, single family, weights 300–900) **Admin style:** Light & Airy — white/light sidebar, teal accents, minimal card layout, single-page forms --- ## Key Business Rules (NEVER violate) 1. **No e-commerce** — no prices, no cart, no payment on the public site 2. **No Ayurvedic / Veterinary** — removed per client 3. **No membership/registration** — enquiry form is the ONLY lead capture 4. **WhatsApp button fixed** on every page at bottom-right 5. **Both emails get every enquiry:** `chandraandsonssurgical@gmail.com` AND `info@chandrasons.com` 6. **Google Reviews always imported as `draft`** — admin approves individually 7. **Language fallback:** missing NE/HI silently falls back to EN 8. **Blog is English only** — Google Translate widget for other languages --- ## Database — 16 Tables `users`, `languages`, `settings`, `menus`, `menu_items`, `pages`, `hero_banners`, `stats`, `services`, `product_categories`, `products`, `brand_partners`, `testimonials`, `faqs`, `blog_posts`, `enquiries`, `media` **Seeded data:** - 3 languages (EN default, NE, HI) - 35+ settings keys (all contact info, social links, SEO IDs — blank, fill via admin) - 4 services, 4 product categories - 30 brand partners (no logos yet — upload via admin) - 6 FAQs, 3 testimonials, 1 admin user --- ## Complete File Map ``` chandrasons/ ├── app/ │ ├── Filament/ │ │ ├── Pages/ │ │ │ ├── ManageSettings.php ← Site settings (tabbed key-value editor) │ │ │ └── GoogleReviews.php ← Google Reviews importer (Places API) │ │ └── Resources/ │ │ ├── HeroBannerResource.php ← Homepage hero slider │ │ ├── StatResource.php ← Counter stats (150+, 10+, etc.) │ │ ├── ServiceResource.php ← 4 services │ │ ├── ProductCategoryResource.php │ │ ├── ProductResource.php ← Informational catalog (no prices) │ │ ├── BrandPartnerResource.php ← 30 brands, logo upload │ │ ├── TestimonialResource.php ← draft / approved / rejected workflow │ │ ├── FaqResource.php │ │ ├── BlogPostResource.php ← RichEditor + scheduling │ │ ├── EnquiryResource.php ← Read-only list, mark-read, CSV export │ │ └── PageResource.php ← CMS pages (3-lang tabs) │ ├── Http/ │ │ ├── Controllers/ │ │ │ ├── Controller.php ← Base class (created in Session 2) │ │ │ ├── HomeController.php │ │ │ ├── AboutController.php │ │ │ ├── ServiceController.php │ │ │ ├── ProductController.php │ │ │ ├── BrandPartnerController.php │ │ │ ├── FaqController.php │ │ │ ├── BlogController.php │ │ │ ├── ContactController.php │ │ │ ├── EnquiryController.php ← AJAX + dual email + honeypot │ │ │ └── SitemapController.php ← sitemap.xml + robots.txt │ │ └── Middleware/ │ │ └── SetLocale.php ← /{lang}/ prefix → app locale │ ├── Models/ ← 15 models, all use HasTranslations │ ├── Providers/ │ │ ├── AppServiceProvider.php │ │ └── Filament/ │ │ └── AdminPanelProvider.php ← Filament panel config │ ├── Services/ │ │ └── GoogleReviewsService.php │ └── helpers.php ← setting(), lang_url(), whatsapp_url() ├── bootstrap/ │ ├── app.php ← Laravel 11 Application::configure() style │ └── providers.php ← Created Session 2 — registers AdminPanelProvider ├── database/ │ ├── migrations/ ← 16 files │ └── seeders/ ← 10 files (DatabaseSeeder calls all) ├── resources/ │ ├── css/ │ │ └── app.css ← FULL design system (tokens, animations, │ │ glassmorphism, buttons, cards, FAQ, │ │ carousel, reveal, WhatsApp float) │ ├── js/ │ │ └── app.js ← Alpine.js + fetch form submission │ └── views/ │ ├── layouts/ │ │ └── app.blade.php ← Master layout (SEO, tracking, hreflang, │ │ WhatsApp float button) │ ├── partials/ │ │ ├── navbar.blade.php ← ✅ REVAMPED — glass fixed navbar, │ │ │ Alpine dropdowns, lang switcher │ │ ├── footer.blade.php ← ✅ REVAMPED — premium dark footer │ │ ├── enquiry-form.blade.php ← ✅ REVAMPED — glass card, AJAX, success state │ │ └── nepal-enquiry-form.blade.php ← ✅ REVAMPED — Nepal-specific fields │ ├── filament/ │ │ ├── pages/manage-settings.blade.php │ │ └── pages/google-reviews.blade.php │ └── pages/ │ ├── home.blade.php ← ✅ REVAMPED — 11 sections, animated SVG hero │ ├── about.blade.php ← ⏳ pending revamp │ ├── contact.blade.php ← ⏳ pending revamp │ ├── faqs.blade.php ← ⏳ pending revamp │ ├── brand-partners.blade.php ← ⏳ pending revamp │ ├── why-sunauli.blade.php ← ⏳ pending revamp │ ├── services/ │ │ ├── index.blade.php ← ⏳ pending revamp │ │ └── show.blade.php ← ⏳ pending revamp │ ├── products/ │ │ ├── index.blade.php ← ⏳ pending revamp │ │ └── category.blade.php ← ⏳ pending revamp │ └── blog/ │ ├── index.blade.php ← ⏳ pending revamp │ └── show.blade.php ← ⏳ pending revamp ├── config/ │ ├── app.php │ ├── database.php │ ├── seotools.php │ └── translatable.php ├── routes/ │ ├── web.php ← All routes with {lang} prefix group │ └── console.php ├── postcss.config.js ← Created Session 2 (was missing) ├── tailwind.config.js ├── vite.config.js ├── composer.json ← Laravel 11, Filament 3.2, no sitemap pkg ├── package.json └── .env (local — not committed) ``` --- ## Session Log ### Session 1 — Full Project Scaffolded (May 2026) - 144 custom files written across all layers - composer.json, package.json, vite.config.js, tailwind.config.js - 16 migrations, 10 seeders, 15 models, 10 controllers, 10 Filament Resources - All 15 public page blade views (basic structure) - npm install ✅ — npm run build ✅ (initial) ### Session 2 — Setup Fixes + UX/UI Revamp Phase 1 (May 2026) **Setup bugs fixed (do NOT re-apply):** - `Database\Seeders` added to composer.json autoload → `composer dump-autoload` run - `app/Http/Controllers/Controller.php` created (Laravel 11 doesn't auto-generate it) - `bootstrap/providers.php` created (missing → Filament admin panel 404) - All 9 Filament Resource `getPages()` fixed: `List*Resources` → `List*Resource` (trailing s removed) - `app/Filament/Resources/PageResource.php` created (parent file was missing) - `CACHE_STORE=file` added to .env (Laravel 11 renamed env key from CACHE_DRIVER) - `postcss.config.js` created (was missing → Tailwind directives not compiled, CSS only 2KB) - `.env` fixed: `APP_URL=http://localhost:8000`, `MAIL_MAILER=log` **Design revamp completed:** - `resources/css/app.css` — complete Modern Minimal design system - `resources/views/partials/navbar.blade.php` — glass navbar, Alpine.js dropdowns - `resources/views/partials/footer.blade.php` — premium dark footer - `resources/views/pages/home.blade.php` — full 11-section homepage with animated pharmacy SVG hero - `resources/views/partials/enquiry-form.blade.php` — glass card AJAX form - `resources/views/partials/nepal-enquiry-form.blade.php` — Nepal-specific form - `resources/js/app.js` — Alpine.js + fetch enquiry handler **Admin credential fix:** ```bash php artisan tinker --execute="App\Models\User::where('email','admin@chandrasons.com')->update(['password'=>bcrypt('Admin@1234'),'email_verified_at'=>now()]);" ``` --- ## Session 3 — Admin Panel Revamp (May 2026) ✅ ### Files Created / Modified **New files:** - `resources/css/filament/admin/theme.css` — Full custom Filament theme (600+ lines of Light & Airy CSS) - `app/Filament/Widgets/AdminStatsOverviewWidget.php` — 6-stat dashboard overview (enquiries, unread, testimonials pending, blog posts, brands, products) - `app/Filament/Widgets/RecentEnquiriesWidget.php` — Full-width table of 8 latest enquiries on dashboard - `app/Filament/Pages/Auth/Login.php` — Custom login page class (extends Filament base) - `resources/views/filament/auth/login-brand.blade.php` — Branded header: pharmacy cross SVG, teal gradient, amber divider **Modified files:** - `vite.config.js` — Added `resources/css/filament/admin/theme.css` to Vite inputs - `app/Providers/Filament/AdminPanelProvider.php` — Full revamp: custom theme, teal colors, 6 navigation groups, custom widgets, sidebarCollapsibleOnDesktop, globalSearchKeyBindings, renderHook for login branding - All 11 Filament Resources — complete rewrite with clean sections, icons, language tabs, styled tables, badge colors - `app/Filament/Pages/ManageSettings.php` — Added save notification, cache flush, slug, cleaner header action - `app/Filament/Pages/GoogleReviews.php` — Added slug, preview/import methods **Design decisions:** - Sidebar: white, 1px slate border, 4px left-edge active indicator in teal - Nav badges: amber (#F4A922) for unread enquiries + pending testimonials - Form sections: each section has icon + description, clean 2-column layouts - Tables: `fi-ta-row:nth-child(even)` alternating background, hover highlight - Badges: draft=gray, approved=green, rejected=red, published=green, scheduled=blue - Stats widget: 3-column grid, hover lift, teal icon boxes ### ✅ Admin Panel State After Session 3 - Theme CSS compiles via Vite (`npm run build` needed) - Login page has pharmacy cross icon + teal gradient background - Dashboard: 6 stats + recent enquiries table - All 11 resources: clean section-grouped forms, properly styled tables - Navigation: 6 groups (Content, Products, Brands, Trust, Leads, Settings) - Enquiries nav badge: shows unread count in amber - Testimonials nav badge: shows draft count in amber - One-click Approve/Reject actions directly from testimonials table - WhatsApp quick-reply action on enquiries - Blog post form: auto-slug from title, scheduling, SEO tab collapsed ### 🐛 Session 3 Bug Fixes (applied in same session) **Bug 1 — HeroBannerResource getPages() class name mismatch:** - Error: `Class "App\Filament\Resources\HeroBannerResource\Pages\ListHeroBannerResource" not found` - Cause: Resource referenced `ListHeroBannerResource` but the actual files are `ListHeroBanners`, `CreateHeroBanner`, `EditHeroBanner` (old Session 1 names) - Fix: Updated `getPages()` in `HeroBannerResource.php` to match actual file names **Bug 2 — `ViewAction::make()->after()` not valid in Filament v3:** - Error would have surfaced at runtime on Enquiries page - Fix: Replaced `ViewAction::make()->after(...)` with `Action::make('view')->url(...)` in both `EnquiryResource.php` and `RecentEnquiriesWidget.php` **Bug 3 — renderHook name wrong:** - `panels::auth.login.simple.before` does not exist in Filament v3 - Fix: Changed to `panels::auth.login.form.before` (confirmed from `PanelsRenderHook.php`) - Added second hook `panels::head.end` → `filament.auth.login-head-styles` for login page background gradient CSS **New file added during bug fix:** - `resources/views/filament/auth/login-head-styles.blade.php` — injects teal gradient background CSS on login page only ### ⏳ Session 4 — TODO (pick up here) **After Session 3 — run on Mac terminal:** ```bash cd /Users/bhagwandas/Documents/Claude/Chandra-sons/chandrasons php artisan config:clear && php artisan cache:clear && php artisan view:clear php artisan serve ``` Then test admin at http://localhost:8000/admin (npm run build already done — only re-run if CSS/JS files change) **Priority — Inner Pages Revamp (11 pages still pending):** - `about.blade.php` — story, timeline, team, why-choose-us - `contact.blade.php` — map embed, dual form (general + Nepal), contact cards - `faqs.blade.php` — grouped accordion by category with tabs - `brand-partners.blade.php` — premium logo grid with search/filter - `services/index.blade.php` — hero + 4 service cards - `services/show.blade.php` — service detail with sidebar CTA - `products/index.blade.php` — 4 category cards - `products/category.blade.php` — product list with search - `blog/index.blade.php` — blog grid with featured post - `blog/show.blade.php` — article layout with sidebar - `why-sunauli.blade.php` — SEO landing page for location searches **After any CSS/JS change:** ```bash cd /Users/bhagwandas/Documents/Claude/Chandra-sons/chandrasons npm run build ``` --- ## Filament Admin — Resources & Navigation | Resource | Nav Group | Icon | Purpose | |---|---|---|---| | ManageSettings | Settings | cog | All site settings in tabs | | GoogleReviews | Settings | star | Import Google reviews as drafts | | HeroBannerResource | Content | photo | Homepage slider slides | | StatResource | Content | chart-bar | 4 counter stats | | ServiceResource | Content | briefcase | 4 services | | PageResource | Content | document-text | CMS pages | | BlogPostResource | Content | pencil | Blog articles | | ProductCategoryResource | Products | tag | 4 categories | | ProductResource | Products | cube | Product catalog | | BrandPartnerResource | Brands | building-office | 30 brand logos | | TestimonialResource | Trust | chat-bubble | Reviews (draft→approved) | | FaqResource | Trust | question-mark | FAQ accordion | | EnquiryResource | Leads | inbox | Lead inbox (read-only) | --- ## Useful Commands ```bash # Start dev server php artisan serve # Rebuild frontend assets (run after any CSS/JS change) npm run build # Clear all caches php artisan config:clear && php artisan cache:clear && php artisan route:clear && php artisan view:clear # Re-seed database (drops all data!) php artisan migrate:fresh --seed # Reset admin password php artisan tinker --execute="App\Models\User::where('email','admin@chandrasons.com')->update(['password'=>bcrypt('Admin@1234'),'email_verified_at'=>now()]);" # Create Filament theme (run once on Mac) php artisan make:filament-theme # Dump autoload after composer.json changes composer dump-autoload ``` --- ## Content Still Needed From Client - [ ] Store photos (interior + exterior, min 5–10, high-res) - [ ] Logo in SVG or PNG with transparent background - [ ] Favicon (512×512px square) - [ ] Confirmed brand list (which of 30 do they actually distribute?) - [ ] Brand partner logos - [ ] Year of establishment (assumed 2010) - [ ] Drug distribution license number - [ ] Real client testimonials (5–10 with names, company, city, quote) - [ ] Nepal export process details (MOQ, lead time, docs required) - [ ] Google Maps Place ID (for reviews extractor) - [ ] Product list per category (top 20–30 per category) - [ ] Nepali & Hindi translations for key pages ## Post-Launch Technical Checklist - [ ] Set SMTP mail credentials in `.env` for real email delivery - [ ] Add GA4 / GTM / Meta Pixel IDs via Admin → Site Settings → SEO tab - [ ] Set Google Maps API key via Admin → Site Settings → SEO tab - [ ] Upload brand partner logos via Admin → Brand Partners - [ ] Add hero banner slides + images via Admin → Hero Banners - [ ] Set up cPanel cron: `* * * * * php artisan schedule:run` (every minute) - [ ] Point chandrasons.com DNS to hosting - [ ] Set 301 redirect: chandraandsons.in → chandrasons.com - [ ] Submit sitemap.xml to Google Search Console --- *Last updated: Session 3 complete + Bug Fixes — May 2026*