larah5p/larah5p

Advanced H5P integration for Laravel 10+ - filament fork

Maintainers

Package info

github.com/MusabAlzoubi/larah5p

pkg:composer/larah5p/larah5p

Fund package maintenance!

musabAlzoubi

Statistics

Installs: 43

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2025-02-18 20:16 UTC

This package is auto-updated.

Last update: 2026-06-09 07:40:30 UTC


README

LaraH5P is a Laravel package that provides seamless integration with H5P, allowing you to create, manage, and interact with interactive content directly within your Laravel application.

📌 Features

  • Full integration with H5P Core and H5P Editor.
  • Content management (create, edit, delete).
  • Library management with AJAX support.
  • Export and embed H5P content.
  • Permission-based access control.
  • Fully customizable.

📥 Installation

1. Install the package

Run the following command in your Laravel project:

composer require larah5p/larah5p

2. Publish the package assets, config, migrations, and views

php artisan vendor:publish --provider="LaraH5P\Providers\LaraH5PServiceProvider" --force

This will publish:

  • Config file: config/larah5p.php
  • Migrations: database/migrations
  • Views: resources/views/vendor/larah5p
  • Language files: resources/lang/vendor/larah5p
  • Assets: public/vendor/larah5p

3. Run migrations

php artisan migrate

4. Generate an application key

If you haven't generated an application key yet, run:

php artisan key:generate

5. Clear and cache configurations

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

🔧 Configuration

LaraH5P provides a configuration file that allows you to customize the package settings.

You can find it at:

config/larah5p.php

Key Settings:

  • Default layout
  • Storage paths
  • Debugging options
  • User permissions

🌍 Routes

LaraH5P registers various routes for managing H5P content and libraries. To list them, run:

php artisan route:list

Main Routes:

Route Controller Description
/h5p H5pController Manage H5P content
/library LibraryController Manage H5P libraries
/ajax AjaxController Handle AJAX requests
/h5p/embed/{id} EmbedController Embed H5P content
/h5p/export/{id} DownloadController Export H5P content

🎨 Optional Packages

LaraH5P supports additional Laravel packages for extended functionality.

1. Spatie Laravel Permissions

If you need role-based permissions, install Spatie's Laravel Permission package:

composer require spatie/laravel-permission

Then, publish and run migrations:

php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
php artisan migrate

2. Filament Admin Panel

If you want to use Filament for managing H5P content from an admin panel, install:

composer require filament/filament

Then, publish Filament assets:

php artisan vendor:publish --tag=filament-config

🛠 Customization

You can override package views by modifying the files in:

resources/views/vendor/larah5p

If you want to extend functionality, create your own controllers:

php artisan make:controller MyCustomH5PController

🚀 Contributing

Contributions are welcome! If you find any issues or have suggestions, feel free to open a pull request or create an issue.

📄 License

This package is open-source and licensed under the MIT License.

📧 Contact

For questions or support, contact:

📧 Email: musab.m.alzoubii@gmail.com

🎯 Now you're ready to use LaraH5P in your Laravel project! 🚀