# StarMeet - XAMPP Setup Guide (Laravel 11)

Complete setup guide for running StarMeet Celebrity Booking Agency on XAMPP with Laravel 11.

## System Requirements

### Minimum Requirements
- **PHP**: 8.2 or higher (Laravel 11 requirement)
- **MySQL**: 5.7+ or MariaDB 10.3+
- **Composer**: 2.x
- **XAMPP**: Version 8.2+ recommended

### Checking Your PHP Version
1. Open XAMPP Control Panel
2. Click "Shell" button
3. Run: `php -v`
4. Ensure version is 8.2.0 or higher

If you have an older XAMPP version, download the latest from [apachefriends.org](https://www.apachefriends.org)

## Installation Steps

### Step 1: Download and Install XAMPP

1. Visit [https://www.apachefriends.org](https://www.apachefriends.org)
2. Download XAMPP for Windows (PHP 8.2+ version)
3. Run the installer
4. Install to `C:\xampp` (default location recommended)
5. Ensure **Apache** and **MySQL** components are selected

### Step 2: Extract StarMeet Files

1. Extract `starmeet-laravel.zip` to:
   ```
   C:\xampp\htdocs\starmeet
   ```

2. Your folder structure should look like:
   ```
   C:\xampp\htdocs\starmeet\
   ├── app\
   ├── bootstrap\
   ├── config\
   ├── database\
   ├── public\
   ├── resources\
   ├── routes\
   ├── storage\
   ├── composer.json
   ├── artisan
   └── ...
   ```

### Step 3: Start XAMPP Services

1. Open **XAMPP Control Panel**
2. Click **Start** next to **Apache**
3. Click **Start** next to **MySQL**
4. Both services should show green (running)

### Step 4: Create Database

1. Open your browser
2. Go to: `http://localhost/phpmyadmin`
3. Click **New** (left sidebar)
4. Enter database name: `starmeet`
5. Click **Create**

### Step 5: Install Dependencies

#### Option A: Using setup-xampp.bat (Recommended)
1. Navigate to `C:\xampp\htdocs\starmeet`
2. Double-click `setup-xampp.bat`
3. Wait for the installation to complete

#### Option B: Manual Installation
1. Open Command Prompt as Administrator
2. Navigate to the project folder:
   ```cmd
   cd C:\xampp\htdocs\starmeet
   ```
3. Install Composer dependencies:
   ```cmd
   composer install
   ```
4. Copy environment file:
   ```cmd
   copy .env.xampp .env
   ```
5. Generate application key:
   ```cmd
   php artisan key:generate
   ```
6. Run migrations and seeders:
   ```cmd
   php artisan migrate --seed
   ```
7. Create storage link:
   ```cmd
   php artisan storage:link
   ```

### Step 6: Set Folder Permissions (Windows)

1. Open Command Prompt as Administrator
2. Run these commands:
   ```cmd
   cd C:\xampp\htdocs\starmeet
   icacls storage /grant Everyone:F /T
   icacls bootstrap/cache /grant Everyone:F /T
   ```

### Step 7: Access the Application

1. Open your browser
2. Go to: `http://localhost/starmeet`
3. You should see the StarMeet homepage!

## Default Login Credentials

| Role | Email | Password |
|------|-------|----------|
| **Admin** | admin@starmeet.com | password |
| **User** | user@example.com | password |

## Troubleshooting

### Issue: "PHP version 8.2.0 or higher is required"

**Solution:**
1. Check your PHP version: Open XAMPP Shell, run `php -v`
2. If version is below 8.2:
   - Download latest XAMPP from [apachefriends.org](https://www.apachefriends.org)
   - Or update PHP manually in your existing XAMPP

### Issue: "Failed to open stream: Permission denied"

**Solution:**
```cmd
icacls storage /grant Everyone:F /T
icacls bootstrap/cache /grant Everyone:F /T
```

### Issue: "SQLSTATE[HY000] [1049] Unknown database"

**Solution:**
1. Open phpMyAdmin: `http://localhost/phpmyadmin`
2. Create database named `starmeet`
3. Run migrations again: `php artisan migrate --seed`

### Issue: "The requested URL was not found"

**Solution:**
1. Ensure `mod_rewrite` is enabled in Apache
2. Check that `.htaccess` exists in `public/` folder
3. Restart Apache from XAMPP Control Panel

### Issue: "Class not found" errors

**Solution:**
```cmd
composer dump-autoload
```

### Issue: "No application encryption key has been specified"

**Solution:**
```cmd
php artisan key:generate
```

### Issue: Composer timeout or memory errors

**Solution:**
```cmd
composer install --no-scripts --no-interaction
```

## Laravel 11 Specific Notes

### Directory Structure Changes
Laravel 11 has a slimmer directory structure:
- Config files are now optional
- New `bootstrap/providers.php` file
- Updated `bootstrap/app.php` format

### Key Files Updated
- `composer.json` - Updated for Laravel 11
- `bootstrap/app.php` - New format with middleware configuration
- `bootstrap/providers.php` - Service providers list
- All Models - Now use `casts()` method instead of `$casts` property

### PHP 8.2 Features Used
- Readonly classes
- Null-safe operator
- Match expressions
- Named arguments
- Constructor property promotion

## Post-Installation Setup

### Configure Payment Methods (Admin)

1. Login as admin: `admin@starmeet.com`
2. Go to **Admin Dashboard**
3. Click **Payment Settings**
4. Configure your payment methods:
   - Bank Transfer
   - PayPal
   - Venmo
   - Cash App
   - Zelle

### Add Your First Celebrity (Admin)

1. Login as admin
2. Go to **Admin Dashboard**
3. Click **Celebrities**
4. Click **Add New Celebrity**
5. Fill in details and upload images

## Useful Commands

```cmd
# Clear cache
php artisan cache:clear
php artisan config:clear
php artisan view:clear

# Run migrations
php artisan migrate

# Run seeders
php artisan db:seed

# Reset database
php artisan migrate:fresh --seed

# Check routes
php artisan route:list

# Serve application (alternative to XAMPP)
php artisan serve
```

## File Structure

```
C:\xampp\htdocs\starmeet\
├── app\
│   ├── Http\Controllers\     # All controllers
│   ├── Models\               # Eloquent models
│   └── Providers\            # Service providers
├── bootstrap\
│   ├── app.php               # Laravel 11 app bootstrap
│   └── providers.php         # Service providers list
├── config\                   # Configuration files
├── database\
│   ├── migrations\           # Database migrations
│   └── seeders\              # Database seeders
├── public\                   # Web root
│   └── index.php             # Entry point
├── resources\
│   └── views\                # Blade templates
├── routes\
│   ├── web.php               # Web routes
│   ├── api.php               # API routes
│   └── console.php           # Console routes
├── storage\                  # Storage directory
└── composer.json             # Dependencies
```

## Support

For issues or questions:
- Email: support@starmeet.com
- Documentation: README.md

---

**StarMeet** - Built with Laravel 11 & XAMPP
