djoudi / laravel-h5p
H5P Plugin for Laravel platform - Updated for Laravel 12
Installs: 488
Dependents: 0
Suggesters: 0
Security: 0
Stars: 23
Watchers: 10
Forks: 48
Open Issues: 12
pkg:composer/djoudi/laravel-h5p
Requires
- php: ^7.0
- guzzlehttp/guzzle: ^6.2
- h5p/h5p-core: ^1.14
- h5p/h5p-editor: ^1.13
- laravel/framework: 5.5.*
- laravelcollective/html: ^5.5
- nesbot/carbon: ^1.22
- twbs/bootstrap-sass: @stable
Requires (Dev)
- fzaninotto/faker: ^1.6
- mockery/mockery: 0.9.*
- phpunit/phpunit: ~5.7
- xethron/migrations-generator: ^2.0
This package is auto-updated.
Last update: 2025-12-07 13:48:33 UTC
README
A comprehensive Laravel package for H5P interactive content with xAPI/LRS support.
✨ Features
- 📦 H5P Content Management (Create, Edit, Delete)
- 📚 Library Management
- 📊 Student Results Tracking
- 🔗 xAPI/LRS Integration
- 📈 Reports & Analytics
- 🎨 Tailwind CSS Admin Interface
- 🌍 Multi-language Support (EN, AR, FR)
📋 Requirements
- PHP 8.2+
- Laravel 11/12
- PostgreSQL/MySQL
🚀 Installation
1. Install via Composer
composer require djoudi/laravel-h5p
2. Run Installation Command
php artisan h5p:install
This will:
- Publish configuration files
- Run database migrations
- Create storage directories
- Link storage to public
3. Check Installation Status
php artisan h5p:status
⚙️ Configuration
Environment Variables
Add to your .env:
# H5P Settings H5P_STORAGE_PATH=h5p # LRS/xAPI Integration (Optional) LRS_ENABLED=true LRS_ENDPOINT=https://your-lrs.com/data/xAPI LRS_USERNAME=your-key LRS_PASSWORD=your-secret
📖 Available Commands
| Command | Description |
|---|---|
php artisan h5p:install |
Full installation with migrations |
php artisan h5p:publish --force |
Republish assets and config |
php artisan h5p:cleanup --temp |
Clean temporary files |
php artisan h5p:cleanup --unused |
Remove unused libraries |
php artisan h5p:status |
Show installation status |
🔧 Usage
Admin Routes
| Route | Description |
|---|---|
/h5p/library |
Manage H5P libraries |
/admin/h5p |
Manage H5P content |
/admin/reports |
View reports |
Student Routes
| Route | Description |
|---|---|
/lesson/{id} |
View H5P content |
Programmatic Usage
use Illuminate\Support\Facades\App; // Get H5P instance $h5p = App::make('LaravelH5p'); // Get content $content = $h5p->get_content($id); // Get embed code $embed = $h5p->get_embed($content, $settings);
🔗 xAPI/LRS Integration
When LRS is enabled, student results are automatically sent to your LRS:
- Set
LRS_ENABLED=truein.env - Configure LRS credentials
- Run queue worker:
php artisan queue:work
📁 Directory Structure
storage/app/public/h5p/
├── content/ # H5P content files
├── libraries/ # H5P libraries
└── temp/ # Temporary files
🤝 Contributing
Contributions are welcome! Please read our contributing guidelines.
📄 License
MIT License - see LICENSE file.