Installation
How to install OI Laravel Metadata via Composer
Installation
Via Composer
composer require oi-lab/oi-laravel-metadataThe package auto-discovers and registers its service provider via Laravel's package discovery — no manual
registration required. It depends on spatie/laravel-data, which is installed automatically.
Run the migrations
The package ships the metadata and open_graphs migrations. They are loaded automatically from the package,
so php artisan migrate works even without publishing. Publish them only when you need to customize the
schema:
php artisan vendor:publish --tag=oi-laravel-metadata-migrations
php artisan migrateThis creates the metadata and open_graphs tables, each with a unique index on the morph columns so a parent
never gets a second record.
Publish the configuration (optional)
php artisan vendor:publish --tag=oi-laravel-metadata-configThis creates config/oi-laravel-metadata.php with sensible defaults. See
Configuration for all available options.
Seed default settings (optional)
If your application exposes a key/value Setting model, seed the package's default metadata settings:
php artisan metadata:install-settingsThe command is idempotent and no-ops gracefully when no Setting model is present. See
Setting Integration for details.
Local development
To use the package from a local checkout alongside your project, add a path repository to your project's
composer.json:
{
"repositories": [
{
"type": "path",
"url": "./packages/oi-lab/oi-laravel-metadata"
}
]
}Then composer require oi-lab/oi-laravel-metadata.