PHPackages                             cohensive/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. [Image &amp; Media](/categories/media)
4. /
5. cohensive/embed

ActiveLibrary[Image &amp; Media](/categories/media)

cohensive/embed
===============

Media Embed (for Laravel or as a standalone).

v5.6.0(1y ago)120370.4k—3.4%23[2 PRs](https://github.com/KaneCohen/embed/pulls)BSD-3-ClausePHPPHP &gt;=5.3.0CI failing

Since Dec 11Pushed 1y ago5 watchersCompare

[ Source](https://github.com/KaneCohen/embed)[ Packagist](https://packagist.org/packages/cohensive/embed)[ RSS](/packages/cohensive-embed/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (26)Used By (0)

New Version
===========

[](#new-version)

If you're running PHP 8+ I highly recommend using new version of the library: [OEmbed](https://github.com/KaneCohen/oembed).
It has more features while still working almost the same way as this one.

Embed
=====

[](#embed)

Generate media html (YouTube, Vimeo, Kickstarter etc.) based on the url.

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

[](#installation)

Add following require to your `composer.json` file:

For Laravel 5:

```
    "cohensive/embed": "dev-master"
    // or
    "cohensive/embed": "5.5.*"

```

For Laravel 4:

```
    "cohensive/embed": "4.3.*"

```

Then run `composer install` or `composer update` to download it and autoload.

In `providers` array you need to add new package:

```
'providers' => array(

	//...
	'Cohensive\Embed\EmbedServiceProvider',
	//...

)

```

In aliases:

```
'aliases' => array(

	//...
	'Embed' => 'Cohensive\Embed\Facades\Embed'
	//...

)

```

Usage
-----

[](#usage)

```
$embed = Embed::make('http://youtu.be/uifYHNyH-jA')->parseUrl();
// Will return Embed class if provider is found. Otherwie will return false - not found. No fancy errors for now.
if ($embed) {
	// Set width of the embed.
	$embed->setAttribute(['width' => 600]);

	// Print html: ''.
	// Height will be set automatically based on provider width/height ratio.
	// Height could be set explicitly via setAttr() method.
	echo $embed->getHtml();
}

```

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% 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 ~161 days

Recently: every ~594 days

Total

25

Last Release

668d ago

Major Versions

v4.3.1 → 5.3.x-dev2016-11-08

v4.3.2 → v5.3.12016-11-17

v4.3.3 → v5.4.02017-10-22

4.3.x-dev → v5.4.12018-01-17

v4.4.1 → v5.5.02018-05-16

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/578455?v=4)[Kane Cohen](/maintainers/KaneCohen)[@KaneCohen](https://github.com/KaneCohen)

---

Top Contributors

[![KaneCohen](https://avatars.githubusercontent.com/u/578455?v=4)](https://github.com/KaneCohen "KaneCohen (70 commits)")[![killtw](https://avatars.githubusercontent.com/u/1076225?v=4)](https://github.com/killtw "killtw (4 commits)")[![grambas](https://avatars.githubusercontent.com/u/5207343?v=4)](https://github.com/grambas "grambas (1 commits)")[![ramon-villain](https://avatars.githubusercontent.com/u/1520006?v=4)](https://github.com/ramon-villain "ramon-villain (1 commits)")[![vool](https://avatars.githubusercontent.com/u/441840?v=4)](https://github.com/vool "vool (1 commits)")

---

Tags

laravelyoutubemediavimeoembed

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cohensive-embed/health.svg)

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

###  Alternatives

[cohensive/oembed

Media embed generation using OEmbed protocol.

3567.1k](/packages/cohensive-oembed)[classic-o/nova-media-library

Tool and field that will let you managing files and add them to the posts

154172.0k](/packages/classic-o-nova-media-library)[tomatophp/filament-media-manager

Manage your media files using spatie media library with easy to use GUI for FilamentPHP

14543.9k3](/packages/tomatophp-filament-media-manager)[mediamonks/sonata-media-bundle

A powerful, flexible and easy to use alternative for the existing Sonata Media Bundle

109.8k](/packages/mediamonks-sonata-media-bundle)[fg/multiplayer

Builds customizable video embed codes from any URL.

446.8k1](/packages/fg-multiplayer)[stepanenko3/nova-media-field

A Laravel Nova field for laravel-medilibrary.

1717.5k](/packages/stepanenko3-nova-media-field)

PHPackages © 2026

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