Download the PHP package oi-lab/oi-laravel-metadata without Composer

On this page you can find all versions of the php package oi-lab/oi-laravel-metadata. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package oi-laravel-metadata

OI Laravel Metadata

Latest Version on Packagist Total Downloads Tests

A Laravel package to attach polymorphic SEO metadata, Open Graph, and JSON-LD structured data to any Eloquent model — with spatie/laravel-data DTOs, a fluent Schema.org builder, dedicated services, validation rules, head-tag rendering, a @jsonLd Blade directive, and pluggable settings integration (auto-wired to oi-lab/oi-laravel-settings).

Features

The Objects

A Metadata object:

Field Type
title string
description string
keywords string[]
author string
copyright string
language ISO code (e.g. fr, en)
revisit_after string
robots string
googlebot string

An Open Graph object:

Field Type
type string
title string
description string
url string
image object (url, width, height)

A JSON-LD object holds a list of Schema.org graphs, each rendered as its own <script type="application/ld+json"> block:

Field Type
graphs array of Schema.org nodes (Article, BreadcrumbList, Organization, …)

All three are polymorphic, with at most one per parent (enforced by a unique index on the morph columns). The single JSON-LD record can still hold several graphs, so a page can expose multiple structured-data objects.

Requirements

Installation

The package auto-discovers its service provider. Publish and migrate:

This creates the metadata, open_graphs, and json_ld tables.

Local Development

Inside the monorepo, add a path repository to your main project's composer.json:

Usage

Make a Model Meta-aware

Write Values

The trait helpers $page->syncMetadata(...) and $page->syncOpenGraph(...) do the same. Writes use updateOrCreate, so a parent never ends up with a second record.

Render <head> Tags

Use the Blade directives — @meta, @og, and @jsonLd:

Or render straight from the facades ({!! Meta::render($page) !!} / {!! Og::render($page) !!}).

Without passing $page

Set a shared SEO subject once and the directives render it with no argument — set it in a controller or a view composer:

When nothing is set explicitly, the subject is auto-resolved from the current route's model binding — so on a Route::get('/pages/{page}', ...) route the directives just work with zero setup. An explicit argument (@meta($other)) always wins, and auto-resolution can be turned off with the auto_resolve_subject config flag.

Meta::render() outputs description, keywords, author, copyright, language, revisit-after, robots, and googlebot tags, plus google-site-verification / google verification tags resolved from settings. Og::render() outputs the og:* tags plus og:locale, og:site_name, and fb:app_id from settings. Empty values are omitted; all values are HTML-escaped.

JSON-LD Structured Data

Attach Schema.org structured data (per the Google structured data guidelines) with the fluent Schema builder — any method call sets the matching schema.org property, and nested nodes are resolved recursively:

JsonLd::update() accepts a JsonLdData object, a single Schema builder, or raw arrays. The single record holds a list of graphs, so a page can expose several structured-data objects at once. The trait helper $page->syncJsonLd(...) does the same.

Render one <script type="application/ld+json"> block per graph with the @jsonLd Blade directive (or JsonLd::render()):

@jsonLd accepts a model, a JsonLdData object, a Schema builder, or a raw array — handy for ad-hoc, non-persisted structured data:

The rendered JSON is encoded with flags that keep it safe inside a <script> tag (<, >, and & are hex-escaped), and a top-level @context (https://schema.org by default) is injected when the graph does not declare its own. Enable json_ld.pretty in the config to pretty-print while debugging.

Validation

The IsoLanguageRule and RobotsRule rules are reusable on their own.

Setting Integration

Seed the package defaults into your settings backend:

Settings are read and written through a pluggable SettingStore. Install the recommended oi-lab/oi-laravel-settings (listed under suggest) and it is wired automatically. Without it, the package falls back to a generic key/value Setting model or no-ops gracefully.

This inserts the following keys (idempotently — existing keys are never overwritten):

Key Default
METADATA_FACEBOOK_APP_ID ""
METADATA_GOOGLE_SITE_VERIFICATION ""
METADATA_GOOGLE_BOT ""
METADATA_GOOGLE ""
METADATA_ROBOTS index, follow
METADATA_OG_LOCALE fr
METADATA_OG_SITE_NAME ""
METADATA_OG_TYPE website

Configure the backend in config/oi-laravel-metadata.php. Leave store null to auto-detect; the model / column keys drive the generic key/value fallback:

When no store is present, the resolver and installer no-op gracefully and fall back to config defaults. See Advanced → Setting Integration.

Overriding Models

Resolve models through OiMetadata so your overrides apply everywhere:

AI Assistant Skills

Testing

License

The MIT License (MIT). Please see the License File for more information.

Credits

Olivier Lacombe - Creator and maintainer

Olivier is a Product & Technology Director based in Montpellier, France, with over 20 years of experience innovating in UX/UI and emerging technologies. He specializes in guiding enterprises toward cutting-edge digital solutions, combining user-centered design with continuous optimization and artificial intelligence integration.

Projects & Resources:

Support

For support, please open an issue on the GitHub repository.


All versions of oi-laravel-metadata with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
spatie/laravel-data Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package oi-lab/oi-laravel-metadata contains the following files

Loading the files please wait ...