# License Protection System

Professional license protection system compliant with Envato rules.

## Components

### Services

1. **LixServ** (`app/Licensing/Services/LixServ.php`)
   - License information management
   - Domain validation
   - Cache management
   - License storage operations

2. **Lixvalid** (`app/Licensing/Services/Lixvalid.php`)
   - License validation via API
   - Status checking
   - Graceful degradation (uses cache if API unavailable)

3. **LixMiddleware** (`app/Http/Middleware/LixMiddleware.php`)
   - Protects admin routes
   - Allows frontend read-only access
   - Shows warning banners (no kill switch)

## Features

- ✅ API-based license verification
- ✅ Encrypted local license storage
- ✅ Domain binding
- ✅ Product ID binding
- ✅ 24-hour cache for performance
- ✅ Graceful degradation (no kill switch)
- ✅ Warning banners only (no destructive behavior)
- ✅ Frontend always accessible (read-only)

## Usage

### Middleware

```php
// Protect admin routes
Route::middleware(['auth', 'role:admin', 'lix:admin'])->group(function () {
    // Admin routes
});

// Frontend routes (always accessible)
Route::middleware(['lix:frontend'])->group(function () {
    // Frontend routes
});
```

### In Controllers

```php
use App\Licensing\Services\Lixvalid;
use App\Licensing\Services\LixServ;

public function __construct(
    private Lixvalid $lixvalid,
    private LixServ $lixServ
) {}

// Check license status
$status = $this->lixvalid->getStatus();

// Check if valid
if ($this->lixvalid->isValid()) {
    // License is valid
}
```

### In Views

```blade
@include('components.license-warning')
```

## Admin License Page

Access at: `/admin/license`

Features:
- License status display
- Domain verification
- Manual verification button
- License information display

## Envato Compliance

- ✅ No kill switch
- ✅ No destructive behavior
- ✅ Graceful degradation
- ✅ Clear warning messages
- ✅ Frontend remains accessible
- ✅ Admin access with warnings only






