PHPackages                             locomotivemtl/charcoal-contrib-embed - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. locomotivemtl/charcoal-contrib-embed

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

locomotivemtl/charcoal-contrib-embed
====================================

Charcoal service provider for an embed property.

0.2.2(4mo ago)01.3k1MITPHPPHP ^5.6 || ^7.2 || ^8.0CI failing

Since Oct 31Pushed 2w ago10 watchersCompare

[ Source](https://github.com/locomotivemtl/charcoal-contrib-embed)[ Packagist](https://packagist.org/packages/locomotivemtl/charcoal-contrib-embed)[ Docs](https://locomotivemtl.github.io/charcoal-contrib-embed/)[ RSS](/packages/locomotivemtl-charcoal-contrib-embed/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (11)Versions (19)Used By (0)

Charcoal Embed
==============

[](#charcoal-embed)

[![License](https://camo.githubusercontent.com/6e1bcaa556cfa6681760f22851b94d2944b9dd8e57cdd155504a2915b231cc5d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c6f636f6d6f746976656d746c2f63686172636f616c2d636f6e747269622d656d6265642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/locomotivemtl/charcoal-contrib-embed)[![Latest Stable Version](https://camo.githubusercontent.com/682f726df3e41b14c20518a76f45d01f84ca17adec48a323c2d3cde887ae7726/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f636f6d6f746976656d746c2f63686172636f616c2d636f6e747269622d656d6265642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/locomotivemtl/charcoal-contrib-embed)

A [Charcoal](https://packagist.org/packages/locomotivemtl/charcoal-app) service provider for the [Embed](https://packagist.org/packages/embed/embed) library.

Installation
------------

[](#installation)

The preferred and only supported method is with Composer:

```
$ composer require locomotivemtl/charcoal-contrib-embed
```

### Dependencies

[](#dependencies)

#### Required

[](#required)

- **[PHP](https://php.net)** v5.6, v7.2 to v7.4, or v8
- **[locomotivemtl/charcoal-app](https://packagist.org/packages/locomotivemtl/charcoal-app)** : v0.8+
- **[locomotivemtl/charcoal-config](https://packagist.org/packages/locomotivemtl/charcoal-config)** : v0.10+
- **[locomotivemtl/charcoal-property](https://packagist.org/packages/locomotivemtl/charcoal-property)** : v0.8+
- **[guzzlehttp/guzzle](https://packagist.org/packages/guzzlehttp/guzzle)** : v6 or v7
- **[guzzlehttp/promises](https://packagist.org/packages/guzzlehttp/promises)** : v1.4 or v2
- **[embed/embed](https://packagist.org/packages/embed/embed)** : v3.4

Service Provider
----------------

[](#service-provider)

### Services

[](#services)

- **embed/repository** is an instance of `Charcoal\Embed\EmbedRepository` and serves as the primary API for fetching and caching embed data.

Configuration
-------------

[](#configuration)

Including the embed module in the projects's configuration file will register the service provider and the \[locomotivemtl/charcoal-admin\] route for remotely updating the cached embed information:

```
{
    "modules": {
       "charcoal/embed/embed": {}
    }
}
```

Otherwise, the service provider can be included directly:

```
{
    "service_providers": {
        "charcoal/embed/service-provider/embed": {}
    }
}
```

The contrib package can be configured from the the project's configuration file (default values for illustration):

```
{
    "embed_config": {
        "ttl": 3600,
        "format": "array",
        "table": "embed_cache"
    }
}
```

Usage
-----

[](#usage)

The contrib package provides a custom `embed` model property that upon save will fetch the URL's embed information and store a subset of that data in a custom database table.

```
{
    "video": {
        "type": "embed",
        "l10n": true,
        "label": "Video",
        "notes": "Absolute URL: https://www.youtube.com/watch?v={video_id}"
    }
}
```

A URL's embed data can be retrieved using the `EmbedRepository`:

```
$this->embedRepository()->embedData('https://youtube.com/{video_id}');
```

Development
-----------

[](#development)

The package can be linted with [squizlabs/php\_codesniffer](https://packagist.org/packages/squizlabs/php_codesniffer) and tested with [phpunit/phpunit](https://packagist.org/packages/phpunit/phpunit) from the following command:

```
$ composer tests
```

### Coding Style

[](#coding-style)

The charcoal-contrib-embed module follows the Charcoal coding-style:

- *[PSR-1](https://www.php-fig.org/psr/psr-1/)*
- *[PSR-2](https://www.php-fig.org/psr/psr-2/)*
- *[PSR-4](https://www.php-fig.org/psr/psr-4/)*, autoloading is therefore provided by *Composer*.
- *[phpDocumentor](http://phpdoc.org/)* comments.
- [phpcs.xml.dist](phpcs.xml.dist) and [.editorconfig](.editorconfig) for coding standards.

Credits
-------

[](#credits)

- [Locomotive](https://locomotive.ca/)

License
-------

[](#license)

Charcoal is licensed under the MIT license. See [LICENSE](LICENSE) for details.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance87

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 56.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~177 days

Recently: every ~203 days

Total

16

Last Release

137d ago

PHP version history (2 changes)0.1PHP &gt;=5.6.0 || &gt;=7.0

0.2.0PHP ^5.6 || ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f3f29e38395113e2400bdd7e51bea982b17f120d4d5a53d4473b53118ee46f8d?d=identicon)[JoelAlphonso](/maintainers/JoelAlphonso)

---

Top Contributors

[![mcaskill](https://avatars.githubusercontent.com/u/29353?v=4)](https://github.com/mcaskill "mcaskill (23 commits)")[![JoelAlphonso](https://avatars.githubusercontent.com/u/10762266?v=4)](https://github.com/JoelAlphonso "JoelAlphonso (11 commits)")[![dominiclord](https://avatars.githubusercontent.com/u/1775204?v=4)](https://github.com/dominiclord "dominiclord (3 commits)")[![veve40](https://avatars.githubusercontent.com/u/7537381?v=4)](https://github.com/veve40 "veve40 (3 commits)")[![MouseEatsCat](https://avatars.githubusercontent.com/u/9273580?v=4)](https://github.com/MouseEatsCat "MouseEatsCat (1 commits)")

---

Tags

charcoal

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/locomotivemtl-charcoal-contrib-embed/health.svg)

```
[![Health](https://phpackages.com/badges/locomotivemtl-charcoal-contrib-embed/health.svg)](https://phpackages.com/packages/locomotivemtl-charcoal-contrib-embed)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
