# Travel In

Complete Travel Booking Management System

Version 4.1
Updated: October 27, 2025

## Overview

### Thank You for Purchasing Travel In!

Welcome to Travel In - a comprehensive travel booking management system built with Laravel 10. This documentation will guide you through installation, configuration, and all the amazing features this system offers.

Important: This is a Laravel 10.10 application requiring PHP 8.1+. Some experience with Laravel framework and server configuration is required.

### What's New in Version 4.1

#### Passport Information

Complete passport details collection for all passengers (adults, children, infants) with 5 required fields.

#### Age-Based Validation

Smart date of birth validation - 18+ for adults, under 18 for children with dynamic date picker limits.

#### Enhanced PDFs

All booking PDFs now include passport information with country name resolution and formatted display.

#### API Updates

Complete API documentation for mobile apps with React Native and Flutter integration examples.

### Core Features

#### Main Modules

- Users Management - Complete user CRUD operations
- Hotels Management - Hotel listings, bookings, reviews
- Tours Management - Tour packages, pricing, availability
- Flights Management - Flight search, booking, Duffel API integration
- Blogs Management - Content management system
- Services Management - Additional services management
- CMS Pages - Custom page creation

#### Location Management

- Countries - Complete country database with flags
- States/Provinces - State management with country association
- Cities - City management with state/country linking
- Airports - Airport database with IATA/ICAO codes

### Multilingual Support

- Dynamic Language Management - Add/edit/delete languages through admin panel
- RTL Support - Automatic Right-to-Left layout for Arabic, Hebrew, etc.
- Content Translation - Translate all dynamic content (tours, hotels, blogs)
- Menu Translation - Translate navigation menus
- Flag Images - Upload custom flag images for each language

### Booking System

- Tour Bookings - Complete tour booking management with email notifications
- Hotel Bookings - Hotel reservation system with room selection
- Flight Bookings - Duffel API integration for real-time flight data
- Payment Gateway - PayPal, Stripe, and Paystack integration

## Server Requirements

Travel In requires a web server with the following specifications:

### Minimum Requirements

#### PHP Requirements

- PHP Version: 8.1 or higher (8.2+ recommended)
- Extensions Required:
  - BCMath PHP Extension
  - Ctype PHP Extension
  - Fileinfo PHP Extension
  - JSON PHP Extension
  - Mbstring PHP Extension
  - OpenSSL PHP Extension
  - PDO PHP Extension
  - Tokenizer PHP Extension
  - XML PHP Extension
  - GD Library / Imagick (for image processing)
  - cURL Extension
  - Zip Extension

#### Database Requirements

- MySQL: Version 5.7 or higher
- MariaDB: Version 10.2 or higher
- Collation: utf8mb4_unicode_ci (recommended)
- Permissions: CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT

#### Web Server

- Apache 2.4+ with mod_rewrite enabled
- Nginx 1.10+ (alternative to Apache)
- Document Root: Must point to `/public` directory

#### Server Configuration

- Memory Limit: 256M or higher (512M recommended)
- Max Execution Time: 300 seconds or higher
- Max Upload Size: 20M or higher (for image uploads)
- Max Post Size: 25M or higher

Recommended Hosting: VPS or Dedicated hosting for production use. Shared hosting may work but could have performance limitations.
Laravel 10 Requirements: This is a Laravel 10.10 application. Ensure your server meets all Laravel 10 requirements before installation.

## Installation

1

### Server Requirements

- PHP Version: 8.1 or higher
- Laravel: 10.10 or higher
- Database: MySQL 5.7+ or MariaDB 10.2+
- Web Server: Apache or Nginx
- Extensions: OpenSSL, PDO, Mbstring, Tokenizer, XML, Ctype, JSON, BCMath

2

### Upload Files

For Local Development (XAMPP/WAMP):

1. Navigate to your XAMPP `htdocs` folder (or WAMP `www` folder)
2. Create a new folder (e.g., `travelnew`)
3. Extract all files from the package ZIP into this folder
4. Your path should be: `C:\xampp\htdocs\travelnew\`

For Production Server:

1. Upload all files to your domain's public_html directory
2. Ensure proper file permissions are set

3

### Database Setup

You have two options for database setup:

#### Option A: Using SQL File (Quick Setup)

1. Create a new database in phpMyAdmin
2. Import the `travelin25.sql` file located in the root directory
3. Wait for the import to complete

#### Option B: Using Laravel Migrations (Recommended)

1. Create a new database in phpMyAdmin
2. Configure your `.env` file with database credentials
3. Run the following command:

       php artisan migrate

Migrations provide better version control and are recommended for production deployments.

4

### Configure Environment

Open the `.env` file in the root directory and update the following:

    APP_NAME=TravelIn
    APP_ENV=local
    APP_DEBUG=true
    APP_URL=http://localhost/travelnew

    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=your_database_name
    DB_USERNAME=your_username
    DB_PASSWORD=your_password

5

### Clear Cache & Link Storage

Run the following commands in your terminal:

    php artisan cache:clear
    php artisan config:clear
    php artisan route:clear
    php artisan view:clear

Create Storage Link: Visit `http://yourdomain.com/storage-link` to create the symbolic link for profile photos and other uploads.

6

### Default Admin Credentials

Login to the admin panel using:

    URL: http://yourdomain.com/login

    Email: admin@demo.com
    Password: demo2626

Security Notice: Please change the admin credentials immediately after first login!

## Getting Started

### Initial Configuration

#### 1. Site Settings

Navigate to Admin Panel → Settings → Site Settings and configure:

- Site Logo & Favicon
- Company Name & Contact Information
- SMTP Email Configuration
- Duffel API Credentials (for flight search)
- Payment Gateway Settings (PayPal, Stripe, Paystack)

#### 2. Add Languages

Navigate to Admin Panel → Languages → Add New:

1. Enter Language Name (e.g., "Arabic")
2. Enter Language Code (e.g., "ar")
3. Upload Flag Image
4. Check "RTL" if applicable
5. Save

#### 3. Add Location Data

Start adding your location data:

1. Countries: Admin → Locations → Countries
2. States: Admin → Locations → States
3. Cities: Admin → Locations → Cities
4. Airports: Admin → Locations → Airports

### Content Management

#### Add Hotels

Create hotel listings with multiple images, pricing, amenities, and location details.

#### Add Tours

Create tour packages with itinerary, pricing, duration, and booking information.

#### Add Blogs

Create blog posts with categories, tags, and SEO optimization.

#### Manage Menu

Customize navigation menus with multi-level dropdown support.

## Admin Panel Features

The admin panel provides complete control over the entire Travel In system. Access it at: `http://yourdomain.com/login`

Default Credentials:
Email: `admin@demo.com`
Password: `demo2626`
⚠️ Change these immediately after first login!

### Dashboard Overview

The admin dashboard displays key statistics and quick access to important features:

- Statistics Cards: Total bookings, revenue, active users
- Recent Bookings: Latest tour, hotel, and flight bookings
- Revenue Charts: Monthly revenue visualization
- Quick Actions: Access to frequently used features
- System Notifications: Important alerts and updates

### User Management

#### Features

- View All Users: Complete list with search and filters
- Add New User: Create user accounts manually
- Edit User: Update profile information, email, password
- Delete User: Remove user accounts
- User Status: Activate/deactivate accounts
- View Bookings: See all bookings by specific user
- Team Management: Manage team members and permissions

### Tours Management

#### Tour Operations

- Create Tours: Add new tour packages with complete details
- Edit Tours: Update tour information, pricing, availability
- Delete Tours: Remove old or discontinued tours
- Tour Gallery: Upload multiple images per tour
- Pricing Management: Set prices, discounts, seasonal rates
- Itinerary Builder: Day-by-day tour schedule
- Inclusions/Exclusions: What's included in the package

#### Tour Bookings

- View All Bookings: Filter by status, date, customer
- Booking Details: Complete customer and payment info
- Status Management: Pending, Confirmed, Completed, Cancelled
- Email Notifications: Send confirmations and updates
- Payment Tracking: View payment status and amounts

### Hotels Management

#### Hotel Operations

- Add Hotels: Create hotel listings with complete details
- Edit Hotels: Update hotel information and amenities
- Delete Hotels: Remove hotel listings
- Hotel Gallery: Upload hotel photos and images
- Room Management: Different room types with pricing
- Amenities: WiFi, pool, gym, parking, etc.
- Location Details: Map integration and address

#### Hotel Bookings

- View Bookings: All hotel reservations
- Check-in/Check-out: Manage arrival and departure dates
- Guest Details: Complete guest information
- Special Requests: Customer requirements and notes
- Status Updates: Booking confirmation and management

### Flights Management

#### Flight System

- Duffel API Integration: Real-time flight data
- Flight Search: One-way, round-trip, multi-city
- Airlines Management: Manage airline information
- Airports Database: IATA/ICAO codes management
- Pricing Controls: Service fees and markups

#### Flight Bookings (Version 4.1)

- View All Bookings: Complete flight reservation list
- Passenger Details: All passenger information
- Passport Information: Complete passport data for all passengers
- Age Validation: Automatic age verification
- PDF Downloads: Booking tickets with all details
- Payment Status: Track payment completion
- Booking Reference: Unique booking IDs

### Location Management

#### Countries

- Add/Edit/Delete countries
- Country flags upload
- ISO codes management
- Status management

#### States/Provinces

- State management
- Country association
- State codes
- Sort order

#### Cities

- City database
- State/Country linking
- Featured cities
- Status control

#### Airports

- Airport database
- IATA/ICAO codes
- City association
- Type (Intl/Domestic)

### Multilingual System

#### Language Management

- Add Languages: Create new language entries
- Edit Languages: Update language details
- Delete Languages: Remove unused languages
- Flag Upload: Custom flag images for each language
- RTL Support: Enable Right-to-Left for Arabic, Hebrew, etc.
- Default Language: Set primary site language
- Status Control: Enable/disable languages

#### Translation Management

- Menu Translations: Translate navigation menus
- Content Translations: Translate tours, hotels, blogs
- Widget Translations: Homepage widgets and sections
- Static Text: Frontend labels and buttons
- Bulk Translation: Translate multiple items at once

### Content Management

#### Blogs

- Create/Edit blog posts
- Categories & tags
- Featured images
- SEO optimization

#### CMS Pages

- About Us
- Terms & Conditions
- Privacy Policy
- Custom pages

#### Our Experts

- Team members
- Expert profiles
- Social media links
- Photo upload

#### Testimonials

- Customer reviews
- Rating system
- Featured testimonials
- Approval system

### Menu Management

#### Navigation Menus

- Create Menus: Multiple menu locations
- Menu Items: Add/edit/delete menu items
- Nested Menus: Multi-level dropdown support
- Menu Types: Header, Footer, Sidebar menus
- External Links: Link to external websites
- Menu Translations: Translate menu items
- Sort Order: Drag-and-drop menu ordering
- Custom URLs: Add any URL to menu

### Site Settings

#### General Settings

- Site Logo: Upload main and footer logos
- Favicon: Site icon
- Company Info: Name, address, contact details
- Social Media: Facebook, Twitter, Instagram, etc.
- Copyright Text: Footer copyright message
- Currency: Default currency for bookings

#### Email Configuration

- SMTP Settings: Host, port, username, password
- From Email: Sender email address
- From Name: Sender name
- Test Email: Send test emails
- Email Templates: Booking confirmations, notifications

#### Payment Gateway Settings

- PayPal: Client ID, Secret, Mode (Sandbox/Live)
- Stripe: Publishable Key, Secret Key
- Paystack: Public Key, Secret Key
- Service Fees: Add percentage or fixed fees
- Currency Settings: Payment currency configuration

#### Duffel API Settings

- API Token: Duffel access token
- API Mode: Test or Live environment
- Service Fees: Flight booking fees
- Currency: Default flight currency

### Contact Messages

#### Message Management

- View Messages: All contact form submissions
- Message Details: Name, email, subject, message
- Reply: Respond directly from admin panel
- Delete Messages: Remove old messages
- Mark as Read: Organize messages
- Export: Download messages as CSV

### Reviews Management

#### Review System

- View All Reviews: Tours, hotels, flights reviews
- Approve/Reject: Moderate customer reviews
- Edit Reviews: Update review content if needed
- Delete Reviews: Remove inappropriate reviews
- Rating System: 1-5 star ratings
- Featured Reviews: Highlight best reviews
- Email Notifications: Alert admins of new reviews

### Reports & Analytics

#### Available Reports

- Booking Reports: Daily, weekly, monthly booking stats
- Revenue Reports: Total revenue by period
- Payment Reports: Payment gateway wise reports
- User Reports: Registration and activity stats
- Popular Destinations: Most booked locations
- Export Data: Download reports as PDF/Excel

### Security & Permissions

#### Security Features

- Admin Roles: Different permission levels
- Team Management: Multiple admin accounts
- Activity Log: Track admin actions
- Password Protection: Secure password hashing
- Two-Factor Auth: Enhanced security (optional)
- Session Management: Control active sessions

### Homepage Settings

#### Customize Homepage

- Hero Section: Banner image and text
- Search Widget: Homepage search form
- Featured Tours: Highlight top tours
- Featured Hotels: Showcase hotels
- Popular Destinations: Display top cities
- Testimonials Section: Customer reviews
- Blog Posts: Latest blog entries
- Call-to-Action: Custom CTA sections

Admin Dashboard Access: Navigate to `http://yourdomain.com/login` and use your admin credentials to access all these powerful features.
Security Best Practices:

- ✓ Change default admin credentials immediately
- ✓ Use strong passwords with special characters
- ✓ Limit admin user accounts to trusted personnel only
- ✓ Regularly backup your database and files
- ✓ Keep Laravel and dependencies updated
- ✓ Use SSL certificate (HTTPS) in production

## Booking System

Travel In includes comprehensive booking management for tours, hotels, and flights with complete payment integration.

### Tour Bookings

#### Features

- Online Booking: Users can book tours directly from the frontend
- Pricing Management: Dynamic pricing with per-person or per-group options
- Date Selection: Availability calendar for tour dates
- Email Notifications: Automatic confirmation emails to customers and admin
- Booking Management: Admin panel to view and manage all bookings
- Status Tracking: Pending, Confirmed, Completed, Cancelled statuses

### Hotel Bookings

#### Features

- Room Selection: Multiple room types with different pricing
- Check-in/Check-out: Date range selection with automatic rate calculation
- Guest Details: Collect guest information during booking
- Special Requests: Allow customers to add special requirements
- Payment Integration: Multiple payment gateway support
- Booking Confirmation: Instant confirmation with booking reference

### Flight Bookings

#### Features

- Duffel API Integration: Real-time flight search and booking
- Multi-Passenger Support: Adults, children, and infants
- Passport Information: Complete passport details collection (Version 4.1)
- Age Validation: Smart age-based DOB validation (Version 4.1)
- Optional Add-ons: Extra services like meals, baggage, seats
- Price Breakdown: Transparent pricing with taxes and fees
- PDF Tickets: Downloadable booking confirmation PDFs
- Admin Management: Full booking management in admin panel

### Admin Booking Management

Navigate to Admin Panel → Bookings to:

- View all tour, hotel, and flight bookings
- Filter bookings by status, date, or customer
- Update booking status
- View complete passenger and passport details
- Download booking PDFs
- Send confirmation emails
- Manage cancellations and refunds

Pro Tip: All booking data is stored with complete audit trails, allowing you to track changes and maintain customer history.

## Payment Gateway Integration

Travel In supports multiple payment gateways for processing tour, hotel, and flight bookings. Below are detailed setup guides for each gateway:

### Supported Payment Gateways

#### PayPal

Global payment processor with worldwide coverage

#### Stripe

Modern payment platform for credit/debit cards

#### Paystack

African payment gateway integration

### 1. PayPal Setup Guide

1

### Create PayPal Developer Account

1. Visit https://developer.paypal.com
2. Click "Log In" or "Sign Up" if you don't have an account
3. Use your existing PayPal account or create a new one
4. Accept the developer agreement

2

### Create a PayPal App

1. Go to Dashboard > My Apps & Credentials
2. Select "Sandbox" for testing or "Live" for production
3. Click "Create App" button
4. Enter your App Name (e.g., "TravelIn")
5. Select app type: "Merchant"
6. Click "Create App"

3

### Get API Credentials

After creating the app, you'll see:

- Client ID: Copy this value
- Secret: Click "Show" and copy this value

Note: Keep these credentials secure. Never share them publicly or commit them to version control.
4

### Configure in Travel In Admin

1. Login to Admin Panel
2. Navigate to Settings → PayPal Settings
3. Enable PayPal: `Yes`
4. PayPal Mode: `sandbox` (for testing) or `live` (for production)
5. Paste your Client ID
6. Paste your Secret
7. Click "Save Settings"

### 2. Stripe Setup Guide

1

### Create Stripe Account

1. Visit https://stripe.com
2. Click "Sign Up" or "Start Now"
3. Enter your email and create a password
4. Complete business information
5. Verify your email address

2

### Get API Keys

1. Login to Stripe Dashboard
2. Click "Developers" in the left sidebar
3. Click "API keys"
4. You'll see two sets of keys:
   - Test keys (for development)
   - Live keys (for production - visible after activation)
5. For each set, copy:
   - Publishable key: Starts with `pk_test_` or `pk_live_`
   - Secret key: Starts with `sk_test_` or `sk_live_` (click "Reveal" first)

3

### Configure in Travel In Admin

1. Login to Admin Panel
2. Navigate to Settings → Stripe Settings
3. Enable Stripe: `Yes`
4. Paste your Publishable Key
5. Paste your Secret Key
6. Click "Save Settings"

Important: Use test keys during development. Only switch to live keys when you're ready to accept real payments and have completed Stripe account activation.

### Testing Payment Gateways

#### General Testing Steps

1. Use sandbox/test mode credentials for all gateways
2. Test card numbers (each gateway provides their own):
   - Stripe: `4242 4242 4242 4242`
   - PayPal: Use PayPal sandbox accounts
   - Paystack: `4084 0840 8408 4081`
3. Make a test booking (tour, hotel, or flight)
4. Verify transaction appears in:
   - Gateway dashboard
   - Travel In admin panel
   - Customer email confirmation
5. Test both successful and failed transactions
6. Once satisfied, switch to live mode credentials

Go Live Checklist:

- ✓ Complete business verification on the gateway
- ✓ Replace test keys with live/production keys
- ✓ Change mode from sandbox/test to live/production
- ✓ Test with a small real transaction
- ✓ Ensure SSL certificate is installed on your domain
- ✓ Review gateway's terms of service and fees

Payment Security: All payment processing is handled securely through the gateway's PCI-compliant servers. Travel In never stores sensitive card information.

## Database Migrations

Travel In includes complete Laravel migration files for all database tables, providing version-controlled database management.

### What are Migrations?

Migrations are Laravel's way of version controlling your database schema. They allow you to:

- ✅ Track database schema changes in version control
- ✅ Set up fresh databases easily
- ✅ Share schema with team members
- ✅ Roll back changes if needed
- ✅ Test with fresh database instances

### Available Migration Files

All migration files are located in `database/migrations/` including:

#### Core System

Languages, translations, modules, menus, settings

#### Location Data

Countries, states, cities, airports

#### Booking System

Tour bookings, hotel bookings, flight bookings

#### Content

Content translations, widget translations

### Using Migrations

#### Fresh Installation (New Environment)

    php artisan migrate

This creates all tables in your database automatically.

#### Fresh Database for Testing

    php artisan migrate:fresh

Warning: This command drops all tables and recreates them. Only use on development/testing environments!

#### Rollback Last Migration

    php artisan migrate:rollback

#### Check Migration Status

    php artisan migrate:status

#### Run Specific Migration

    php artisan migrate --path=database/migrations/filename.php

For Existing Database: If you already imported the SQL file, you don't need to run migrations. They're provided for documentation and new environments only.

### Migration Benefits

#### Development

- Version control integration
- Team collaboration
- Environment consistency

#### Deployment

- Automated database setup
- Production deployment
- Database updates

## Troubleshooting

### Common Issues & Solutions

#### ❌ 500 Internal Server Error

Causes & Solutions:

- Permission Issues:

      chmod -R 775 storage bootstrap/cache

- Cache Issues:

      php artisan config:clear
      php artisan cache:clear
      php artisan view:clear
      php artisan route:clear

- Check Error Logs: `storage/logs/laravel.log`
- Missing APP_KEY: Run `php artisan key:generate`

#### ❌ Database Connection Error

Solutions:

- Verify database credentials in `.env` file
- Ensure database exists and user has proper privileges
- Check if MySQL service is running
- Try `DB_HOST=localhost` instead of `127.0.0.1` or vice versa
- Ensure database port (3306) is correct

#### ❌ Blank Page / White Screen

Solutions:

- Check PHP error logs
- Ensure `.env` file exists and is properly configured
- Run: `php artisan key:generate`
- Clear all caches (see above)
- Check file permissions for `storage/` and `bootstrap/cache/`

#### ❌ Images Not Uploading

Solutions:

- Check `public/` directory permissions (755 or 775)
- Increase `upload_max_filesize` in `php.ini` (e.g., 20M)
- Increase `post_max_size` in `php.ini` (e.g., 25M)
- Ensure `storage/` is writable
- Create storage link: Visit `http://yourdomain.com/storage-link`

#### ❌ Emails Not Sending

Solutions:

- Verify MAIL settings in `.env` file
- Test SMTP credentials using a tool like Mailtrap
- Check `storage/logs/laravel.log` for email errors
- Ensure port 587 or 465 is not blocked by firewall
- For Gmail: Use "App Password" not regular password (enable 2FA first)
- Verify your email provider allows SMTP access

#### ❌ Payment Gateway Not Working

Solutions:

- Verify API credentials are correct in admin settings
- Ensure gateway is enabled in admin panel
- Check if in test/sandbox mode for testing
- Review gateway error logs in Laravel logs
- Verify webhook URLs are configured (if required)
- Ensure SSL certificate is installed (required for live payments)

#### ❌ Flight Search Not Working (Duffel API)

Solutions:

- Verify Duffel API token in admin settings
- Check if API token is active and not expired
- Ensure airports are properly configured in database
- Check Laravel logs for API error messages
- Verify your Duffel account has sufficient credits/access

### Maintenance Commands

Useful commands for maintaining your installation:

#### Clear All Caches

    php artisan optimize:clear
    php artisan config:clear
    php artisan cache:clear
    php artisan view:clear
    php artisan route:clear

#### Optimize for Production

    php artisan config:cache
    php artisan route:cache
    php artisan view:cache

#### Check System Status

    php artisan about

#### Test Database Connection

    php artisan tinker
    DB::connection()->getPdo();

Production Tip: Always run optimization commands after deploying updates to production for better performance. Never run `migrate:fresh` on production!
Still Having Issues? Check the `storage/logs/laravel.log` file for detailed error messages. Most errors are logged there with stack traces to help identify the problem.

## New Updates - Version 4.1

### Major Updates in Version 4.1

Version 4.1 introduces significant enhancements to the flight booking system with passport information collection and smart age validation.

### 1. Passport Information Collection

The system now collects complete passport information for all passengers (adults, children, and infants) during flight booking.

#### Required Passport Fields

The following 5 fields are now required for each passenger:

Field Name | Type | Validation | Description
--- | --- | --- | ---
Passport Number | String | Max 50 characters | The passport number as it appears on the passport
Passport Issue Date | Date | Must be before today | Date the passport was issued
Passport Expiry Date | Date | Must be after today | Date the passport expires
Passport Issuing Country | Country ID | Must exist in countries table | The country that issued the passport
Country of Residence | Country ID | Must exist in countries table | Passenger's country of residence

#### Where Passport Info Appears

- Booking Form: Input fields during booking process
- Booking Details Page: Full passport information display
- User PDF Download: Included in booking confirmation PDF
- Admin Order Details: View passport info in admin panel
- Admin PDF Download: Included in admin PDF ticket

#### Data Storage

All passport data is stored in the existing `passenger_details` JSON column in the `flight_bookings` table. No database migration is required!

    {
      "pas_0000AzdG1RvyfvV6hLTiHi": {
        "title": "mr",
        "given_name": "John",
        "family_name": "Doe",
        "email": "john@example.com",
        "phone_number": "1234567890",
        "phonecode": "1",
        "born_on": "1990-01-01",
        "gender": "m",
        "passport_number": "AB1234567",
        "passport_issue_date": "2020-01-01",
        "passport_expiry_date": "2030-12-31",
        "passport_issuing_country": 1,
        "country_of_residence": 1
      }
    }

#### Multi-Language Support

All passport field labels are translatable in 3 languages:

- English (en) - Passport Number, Passport Issue Date, etc.
- Arabic (ar) - رقم الجواز، تاريخ إصدار الجواز، إلخ
- Spanish (es) - Número de pasaporte, Fecha de emisión, etc.

### 2. Age-Based Date Validation

Smart age-based date of birth validation ensures passengers enter correct birth dates based on their passenger type.

#### Validation Rules

#### Adult Passengers

Age Requirement: 18-100 years old

Date Range: From 100 years ago to 18 years ago

Example (Oct 27, 2025):

Can select DOB between:
Oct 27, 1925 to Oct 27, 2007

#### Children/Infants

Age Requirement: Under 18 years old

Date Range: From 18 years ago to today

Example (Oct 27, 2025):

Can select DOB between:
Oct 27, 2007 to Oct 27, 2025

#### Frontend Implementation

The date picker automatically adjusts its min/max dates based on passenger type:

    <!-- For Adults -->
    <input type="date"
           min="1925-10-27"    <!-- 100 years ago -->
           max="2007-10-27"    <!-- 18 years ago -->
           required>

    <!-- For Children -->
    <input type="date"
           min="2007-10-27"    <!-- 18 years ago -->
           max="2025-10-27"    <!-- Today -->
           required>

#### Backend Validation

Server-side validation ensures data integrity even if frontend validation is bypassed:

    // For Adults
    'born_on' => 'required|date|before_or_equal:18_years_ago|after_or_equal:100_years_ago'

    // For Children
    'born_on' => 'required|date|before_or_equal:today|after_or_equal:18_years_ago'

#### Benefits

- ✅ Prevents booking errors before form submission
- ✅ Improves user experience with appropriate date ranges
- ✅ Data validation on both frontend and backend
- ✅ Supports newborns (children can be born today)
- ✅ Handles elderly passengers (up to 100 years old)

### Testing the New Features

#### Test Case 1: Adult Passenger with Passport

1. Search for a flight with 1 adult
2. Fill in passenger details
3. Try to select date of birth - should be limited to 18-100 years old
4. Fill in all 5 passport fields
5. Submit booking
6. Expected: Booking successful with passport data saved

#### Test Case 2: Child Passenger

1. Search for a flight with 1 child
2. Try to select date of birth
3. Expected: Can select any date up to today (including today)
4. Expected: Cannot select dates older than 18 years ago
5. Complete passport fields and submit

#### Test Case 3: Verify Passport Display

1. Complete a flight booking
2. Go to booking details page
3. Download user PDF
4. Check admin panel for booking
5. Download admin PDF
6. Expected: All pages show complete passport information

Note: These features are fully integrated with the existing flight booking system and work seamlessly with all payment gateways. The validation works on both frontend and backend to ensure data integrity.

## Changelog

Version 4.1 - October 27, 2025

#### NEW Passport Information Collection

- Added 5 passport fields (Number, Issue Date, Expiry Date, Issuing Country, Country of Residence)
- Integrated with booking form and all display pages
- Added to user and admin PDF downloads
- Complete API documentation for mobile apps

#### NEW Age-Based Date Validation

- Adults must be 18-100 years old
- Children must be under 18 years old
- Dynamic date picker limits based on passenger type
- Server-side validation for data integrity

#### UPDATED API Endpoints

- Updated booking API to require passport fields
- Added age-based DOB validation in API
- Complete mobile app integration guide with React Native & Flutter examples

#### FIXED Bug Fixes

- Fixed optional add-ons price update issue
- Fixed PDF generation errors
- Fixed passenger loop iteration issues

Version 4.0 - September 2, 2025

#### NEW Migration System

- Added 17 Laravel migration files
- Replaced manual SQL imports with version-controlled migrations
- Improved team collaboration and deployment

#### NEW Enhanced Multilingual System

- Complete translation system for all content
- RTL language support (Arabic, Hebrew, etc.)
- Dynamic language switching with flag images

## Support & Resources

### Documentation Files

#### API_DOCUMENTATION.md

Complete API reference with all endpoints and request/response formats

#### API_PASSPORT_UPDATE.md

Mobile app integration guide with React Native and Flutter examples

#### API_QUICK_REFERENCE.md

Quick reference for API endpoints and validation rules

#### COMPLETE_UPDATE_SUMMARY.md

Complete summary of all changes in version 4.1

#### Important Notice

Customization Support: The code is provided "as is". Customizing code and design-related issues can be done as freelance work on a $10-40 hourly rate only with PayPal and/or Western Union, if Travel In is available.

For Beginners: If you are new to programming, please understand that I cannot fix your site for free. I suggest reading documentation available online regarding using PHP, server requirements, Laravel framework, etc.

### Getting Help

- Item Discussion: Visit the CodeCanyon item discussion section
- Documentation: Read all documentation files thoroughly
- Code Issues: Check code comments for implementation details