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(2mo ago)01.3k1MITPHPPHP ^5.6 || ^7.2 || ^8.0CI failing

Since Oct 31Pushed 2mo 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 yesterday

READMEChangelog (5)Dependencies (11)Versions (18)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)[![Code Quality](https://camo.githubusercontent.com/d6fda800c0ef878bf29c3adfbcd3c966998be55ccbd488ce641a84906aaccc41/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c6f636f6d6f746976656d746c2f63686172636f616c2d636f6e747269622d656d6265642e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/locomotivemtl/charcoal-contrib-embed/)[![Coverage Status](https://camo.githubusercontent.com/ff21c7a09130a5654bfaf665299e51ba7a257c09b34386f2186014186f0e8f3a/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6c6f636f6d6f746976656d746c2f63686172636f616c2d636f6e747269622d656d6265642e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/locomotivemtl/charcoal-contrib-embed)[![Build Status](https://camo.githubusercontent.com/0207a44603607ae837876eeb5cee2d5007f186b4fbbdf4b97f0343aab3db5b15/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c6f636f6d6f746976656d746c2f63686172636f616c2d636f6e747269622d656d6265642e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/locomotivemtl/charcoal-contrib-embed)

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

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
    - [Dependencies](#dependencies)
- [Service Provider](#service-provider)
    - [Parameters](#parameters)
    - [Services](#services)
- [Configuration](#configuration)
- [Usage](#usage)
- [Development](#development)
    - [API Documentation](#api-documentation)
    - [Development Dependencies](#development-dependencies)
    - [Coding Style](#coding-style)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

The preferred (and only supported) method is with Composer:

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

### Dependencies

[](#dependencies)

#### Required

[](#required)

- **[PHP 5.6+](https://php.net)**: *PHP 7* is recommended.
- **[locomotivemtl/charcoal-property](https://packagist.org/packages/locomotivemtl/charcoal-property)** : ^0.8
- **[guzzlehttp/guzzle](https://packagist.org/packages/guzzlehttp/guzzle)** : ^6.0 or ^7.0
- **[embed/embed](https://packagist.org/packages/embed/embed)** : ^3.4.10

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

[](#service-provider)

The following services are provided with the use of [locomotivemtl/charcoal-contrib-embed](https://packagist.org/packages/locomotivemtl/charcoal-contrib-embed)

### Services

[](#services)

- **embed/repository** instance of `Embed\EmbedRepository`
    - **Charcoal\\Embed\\Mixin\\EmbedRepositoryTrait** provided for ease of use.

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

[](#configuration)

Include the embed module in the projects's config file. This will provide everything needed for [locomotivemtl/charcoal-contrib-embed](https://packagist.org/packages/locomotivemtl/charcoal-contrib-embed) to work properly. No need for metadata/views/action/routes path etc.

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

You can provide additional configurations in the project's config file like so :

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

This is the actual default config.

Usage
-----

[](#usage)

The Embed Contrib provides a custom Property type : "embed". When using it, the property will fetch embed data from media providers and store them in a third table.

```
{
    "video": {
        "type": "embed",
        "l10n": true,
        "label": {
            "en": "Video",
            "fr": "Video"
        },
        "notes": "Full video url. ex.: https://www.youtube.com/watch?v=_VIDEO_ID"
    }
}
```

To load the embed data from database, use **EmbedRepository** service method

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

Dependency injection :

```
use EmbedRepositoryTrait;

/**
 * Inject dependencies from a DI Container.
 *
 * @param  Container $container A dependencies container instance.
 * @return void
 */
protected function setDependencies(Container $container)
{
    parent::setDependencies($container);
    $this->setEmbedRepository($container['embed/repository']);
}
```

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

[](#development)

To install the development environment:

```
$ composer install
```

To run the scripts (phplint, phpcs, and phpunit):

```
$ composer test
```

### API Documentation

[](#api-documentation)

- The auto-generated `phpDocumentor` API documentation is available at:

- The auto-generated `apigen` API documentation is available at:
    [https://codedoc.pub/locomotivemtl/charcoal-contrib-embed/master/](https://codedoc.pub/locomotivemtl/charcoal-contrib-embed/master/index.html)

### Development Dependencies

[](#development-dependencies)

- \[php-coveralls/php-coveralls\]\[phpcov\]
- \[phpunit/phpunit\]\[phpunit\]
- \[squizlabs/php\_codesniffer\]\[phpcs\]

### 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.

> Coding style validation / enforcement can be performed with `composer phpcs`. An auto-fixer is also available with `composer phpcbf`.

Credits
-------

[](#credits)

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

License
-------

[](#license)

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

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance83

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 51.4% 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

85d 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 (19 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

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

343121.4M79](/packages/google-cloud-core)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73142.3k25](/packages/jaxon-php-jaxon-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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