# CORS Package Installation Instructions

## Error
```
Target class [Fruitcake\Cors\HandleCors] does not exist.
```

## Solution

The `fruitcake/laravel-cors` package needs to be installed explicitly.

### On Production Server:

1. **Navigate to the Laravel project directory:**
   ```bash
   cd /home/pgmozwxlh0xr/public_html/prod/Code/html2/
   ```

2. **Install the CORS package:**
   ```bash
   composer require fruitcake/laravel-cors
   ```

3. **Publish the CORS config (if needed):**
   ```bash
   php artisan vendor:publish --tag="cors"
   ```
   **Note:** Only run this if you want to regenerate the config file. If `config/cors.php` already exists with your custom settings, skip this step.

4. **Clear Laravel cache:**
   ```bash
   php artisan config:clear
   php artisan cache:clear
   php artisan route:clear
   ```

5. **Restart PHP-FPM/Web Server:**
   ```bash
   sudo service php-fpm restart
   # or
   sudo service apache2 restart
   ```

## Alternative: If Package Installation Fails

If `composer require` fails, you can manually add it to `composer.json`:

1. **Edit `composer.json`:**
   ```json
   "require": {
       ...
       "fruitcake/laravel-cors": "^2.0"
   }
   ```

2. **Run composer update:**
   ```bash
   composer update fruitcake/laravel-cors
   ```

3. **Then follow steps 3-5 above**

## Verify Installation

After installation, verify the package is installed:

```bash
composer show fruitcake/laravel-cors
```

You should see package details if it's installed correctly.

## Current Configuration

The `Kernel.php` file is already configured with:
```php
\Fruitcake\Cors\HandleCors::class,
```

And `config/cors.php` is already configured with:
- `'paths' => ['api/*', 'sanctum/csrf-cookie', 'mobikulhttp/*']`
- `'supports_credentials' => true`
- `'allowed_headers' => ['*']`

Once the package is installed, everything should work.

