# Packages (SEO, i18n, GDPR, Form Protection, XML)

This document lists the recommended Laravel packages for the public HR/EN site (URL prefixes `/hr` and `/en`).

> ⚠️ **Laravel 13 Compatibility Note:** This project uses Laravel 13.1.1. Some popular packages (artesaos/seotools, anhskohbo/no-captcha) do not yet support Laravel 13. Use alternative solutions or wait for updates.

## 1) SEO / Meta / OpenGraph / Twitter / JSON‑LD
**Package:** `artesaos/seotools`

**Status:** ✅ **INSTALLED** - v1.4.1 (Laravel 13 compatible!)

**Why:** All‑in‑one SEO tooling for meta tags, OpenGraph, Twitter cards, and JSON‑LD.

**Install:**
```bash
composer require artesaos/seotools
php artisan vendor:publish --provider="Artesaos\SEOTools\Providers\SEOToolsServiceProvider"
```

**Config:** `config/seotools.php`

**Notes:** Successfully installed and working with Laravel 13.1.1!

---

## 2) XML Sitemap (when site is ready)
**Package:** `spatie/laravel-sitemap`

**Status:** ✅ **INSTALLED** - v8.0.0

**Why:** Generates `sitemap.xml` by crawling or by adding URLs programmatically.

**Install:**
```bash
composer require spatie/laravel-sitemap
```

**Config:** `config/sitemap.php`

**Notes:** ✅ Installed and configured with automatic sitemap generation.

---

## 3) Schema.org (optional, advanced JSON‑LD)
**Package:** `spatie/schema-org`

**Status:** ✅ **INSTALLED** - v4.0.0

**Why:** Fluent builder for detailed Schema.org types (Organization, LocalBusiness, FAQ, Article, Product, etc.).

**Install:**
```bash
composer require spatie/schema-org
```

**Notes:** ✅ Installed for advanced structured data alongside SEO Tools.

---

## 4) i18n / URL localization (`/hr`, `/en`)
**Package:** `mcamara/laravel-localization`

**Why:** Route localization with language prefixes and helpers for hreflang.

**Install:**
```bash
composer require mcamara/laravel-localization
```

**Notes:** Supports clean `/hr` and `/en` routing without subdomains.

---

## 5) GDPR / Cookie consent
**Package:** `spatie/laravel-cookie-consent`

**Why:** Simple cookie consent banner and helpers to block cookies until consent is given.

**Install:**
```bash
composer require spatie/laravel-cookie-consent
```

---

## 6) Form Protection (Honeypot)
**Package:** `spatie/laravel-honeypot`

**Status:** ✅ **INSTALLED** - v4.7.1

**Why:** Simple and effective spam protection without annoying users with CAPTCHA. Creates invisible honeypot fields that bots fill out, automatically rejecting spam submissions.

**Install:**
```bash
composer require spatie/laravel-honeypot
php artisan vendor:publish --tag=honeypot-config
```

**Config:** `config/honeypot.php`

**Usage:**
```php
// In Blade forms:
<x-honeypot />

// Or use middleware:
Route::post('/contact', [ContactController::class, 'store'])
    ->middleware(\Spatie\Honeypot\ProtectAgainstSpam::class);
```

**Notes:** Better user experience than reCAPTCHA. No frustrating puzzle-solving required. Works silently in the background.

---

## 7) Laravel Debugbar (Development)
**Package:** `fruitcake/laravel-debugbar`

**Why:** Powerful debugging tool for Laravel that displays queries, routes, views, and performance metrics in a convenient toolbar.

**Install:**
```bash
composer require fruitcake/laravel-debugbar --dev
php artisan vendor:publish --provider='Fruitcake\LaravelDebugbar\ServiceProvider'
```

**Notes:** Development dependency only. Automatically disabled in production unless configured otherwise.

---

## 8) Log Viewer
**Package:** `opcodesio/log-viewer`

**Why:** Beautiful web-based log viewer for Laravel with search, filtering, and real-time monitoring capabilities.

**Install:**
```bash
composer require opcodesio/log-viewer
php artisan log-viewer:publish
php artisan vendor:publish --tag=log-viewer-config
```

**Notes:** Provides `/log-viewer` route. Configure access control via middleware or gates.

---

## 9) Laravel Backup
**Package:** `spatie/laravel-backup`

**Why:** Simple and reliable backup solution for Laravel applications (database + files) with monitoring and notifications.

**Install:**
```bash
composer require spatie/laravel-backup
php artisan vendor:publish --provider="Spatie\Backup\BackupServiceProvider" --tag=backup-config
php artisan vendor:publish --provider="Spatie\Backup\BackupServiceProvider" --tag=backup-translations
```

**Notes:** Configure backup destinations in `config/backup.php`. Schedule backups in `app/Console/Kernel.php`.

---

## Summary (Quick List)

### ✅ Installed & Laravel 13 Compatible
- ✅ `artesaos/seotools` v1.4.1 — SEO, OpenGraph, Twitter, JSON‑LD (INSTALLED)
- ✅ `spatie/schema-org` v4.0.0 — Advanced schema.org JSON‑LD builder (INSTALLED)
- ✅ `spatie/laravel-sitemap` v8.0.0 — XML sitemap generation (INSTALLED)
- ✅ `spatie/laravel-honeypot` v4.7.1 — Form spam protection (INSTALLED)
- ✅ `spatie/laravel-cookie-consent` v3.4.0 — GDPR cookie banner (INSTALLED)
- ✅ `spatie/laravel-backup` v10.2.1 — Database & file backup (INSTALLED)
- ✅ `fruitcake/laravel-debugbar` — Development debugging toolbar (INSTALLED, dev only)
- ✅ `opcodesio/log-viewer` — Web-based log viewer (INSTALLED)
- ✅ `mcamara/laravel-localization` v2.4 — i18n routing /hr, /en (INSTALLED)

### 📋 Configuration Files Created
- `config/seotools.php` - SEO Tools configuration
- `config/sitemap.php` - Sitemap configuration
- `config/honeypot.php` - Honeypot spam protection
- `config/cookie-consent.php` - GDPR cookie consent
- `config/backup.php` - Backup configuration

### 🛠️ Custom Classes & Controllers
- `app/Helpers/SeoHelper.php` - SEO helper with real LUSAR data
- `app/Http/Controllers/SitemapController.php` - Sitemap & robots.txt generator

### 🗺️ SEO Routes
- `/sitemap.xml` - Auto-generated XML sitemap (17 URLs)
- `/robots.txt` - Search engine crawler instructions

### 📖 Documentation
See detailed SEO documentation:
- [SEO_IMPLEMENTATION.md](SEO_IMPLEMENTATION.md) - Complete implementation report
- [SEO_USAGE.md](SEO_USAGE.md) - Usage guide with examples
- [SEO_PAGES_CONFIG.md](SEO_PAGES_CONFIG.md) - Per-page SEO configuration