PHPackages                             artisan-build/embeddable-links - 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. artisan-build/embeddable-links

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

artisan-build/embeddable-links
==============================

A simple package to transform URLs into embedded links, transforming things like YouTube and video into embeds and using OpenGraph for any pages that have it.

1.0.0(3mo ago)0191↑17.6%MITPHPCI passing

Since Jan 16Pushed 3mo agoCompare

[ Source](https://github.com/artisan-build/embeddable-links)[ Packagist](https://packagist.org/packages/artisan-build/embeddable-links)[ RSS](/packages/artisan-build-embeddable-links/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

[![Artisan Build Package Embeddable Links Logo](https://github.com/artisan-build/embeddable-links/raw/HEAD/art/embeddable-links.png)](https://github.com/artisan-build/embeddable-links/raw/HEAD/art/embeddable-links.png)

Embeddable Links
================

[](#embeddable-links)

Transform URLs into rich embedded content for Laravel applications. Automatically detects and renders embeds for YouTube, Vimeo, GitHub Gists, and generates beautiful link preview cards using OpenGraph metadata.

Warning

This package is currently under active development, and we have not yet released a major version. Once a 0.\* version has been tagged, we strongly recommend locking your application to a specific working version because we might make breaking changes even in patch releases until we've tagged 1.0.

Features
--------

[](#features)

- 🎥 **Video Embeds**: Native players for YouTube and Vimeo with responsive aspect ratios
- 💻 **Code Embeds**: GitHub Gist embedding with syntax highlighting
- 🔗 **OpenGraph Cards**: Beautiful link previews with title, image, and description
- 🌐 **Generic Fallback**: Smart metadata extraction for any URL
- ⚡ **Caching**: Configurable metadata caching to minimize HTTP requests
- 🎨 **Flux UI**: Built with Flux UI Pro components (customizable)
- ✅ **Validation**: Laravel validation rule for embeddable URLs

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

[](#installation)

```
composer require artisan-build/embeddable-links
```

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

[](#configuration)

Publish the configuration file (optional):

```
php artisan vendor:publish --tag=embeddable-links-config
```

### Environment Variables

[](#environment-variables)

```
EMBEDDABLE_LINKS_CACHE_ENABLED=true
EMBEDDABLE_LINKS_CACHE_TTL=86400  # 24 hours in seconds
EMBEDDABLE_LINKS_HTTP_TIMEOUT=5   # HTTP request timeout in seconds
EMBEDDABLE_LINKS_ASPECT_RATIO=16/9
```

Usage
-----

[](#usage)

### Basic Blade Component

[](#basic-blade-component)

```

```

### Custom Aspect Ratio

[](#custom-aspect-ratio)

```

```

### Disable Caching

[](#disable-caching)

```

```

### Custom Link Target

[](#custom-link-target)

By default, OpenGraph and generic link cards open in a new tab (`target="_blank"`). You can override this:

```

```

### Supported Services

[](#supported-services)

**YouTube:**

```

```

**Vimeo:**

```

```

**GitHub Gist:**

```

```

**Any URL with OpenGraph:**

```

```

### URL Validation

[](#url-validation)

Use the `EmbeddableUrl` validation rule:

```
use ArtisanBuild\EmbeddableLinks\Rules\EmbeddableUrl;

$request->validate([
    'url' => ['required', 'url', new EmbeddableUrl],
]);
```

Restrict to specific services:

```
$request->validate([
    'url' => ['required', 'url', new EmbeddableUrl(['youtube', 'vimeo'])],
]);
```

### Programmatic Usage

[](#programmatic-usage)

```
use ArtisanBuild\EmbeddableLinks\Services\EmbedManager;

$manager = app(EmbedManager::class);
$html = $manager->embed('https://www.youtube.com/watch?v=dQw4w9WgXcQ');
```

Customization
-------------

[](#customization)

### Publish Views

[](#publish-views)

```
php artisan vendor:publish --tag=embeddable-links-views
```

Views will be published to `resources/views/vendor/embeddable-links/embeds/`:

- `youtube.blade.php`
- `vimeo.blade.php`
- `github-gist.blade.php`
- `opengraph.blade.php`
- `generic.blade.php`

### Demo Page

[](#demo-page)

Visit `/embeddable-links-demo` to see all embed types in action (development only).

Testing
-------

[](#testing)

```
composer test
composer test-coverage
```

Code Quality
------------

[](#code-quality)

```
composer lint       # Fix code style
composer stan       # Run static analysis
composer ready      # Run all checks
```

How It Works
------------

[](#how-it-works)

1. **URL Detection**: Parses URLs to identify service type (YouTube, Vimeo, Gist, or generic)
2. **Metadata Fetching**: For generic URLs, fetches OpenGraph and HTML metadata
3. **Caching**: Stores metadata in Laravel cache (default: 24 hours)
4. **Rendering**: Uses service-specific Blade templates with Flux UI components

Requirements
------------

[](#requirements)

- PHP 8.3+
- Laravel 11.0+
- Flux UI Pro (for default card styles)

Memberware
----------

[](#memberware)

This package is part of our internal toolkit and is optimized for our own purposes. We do not accept issues or PRs in this repository.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 82% of packages

Maintenance85

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

112d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/55eed7400c452edf7e7adfa4f1c6676b65b5ce1867fff6bddcb80b1bb45360af?d=identicon)[edgrosvenor](/maintainers/edgrosvenor)

---

Top Contributors

[![edgrosvenor](https://avatars.githubusercontent.com/u/1053395?v=4)](https://github.com/edgrosvenor "edgrosvenor (7 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/artisan-build-embeddable-links/health.svg)

```
[![Health](https://phpackages.com/badges/artisan-build-embeddable-links/health.svg)](https://phpackages.com/packages/artisan-build-embeddable-links)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[dusterio/link-preview

Link preview generation for PHP with Laravel support

126326.6k3](/packages/dusterio-link-preview)[madeitbelgium/wappalyzer

PHP Library that uncovers the technologies used on websites.

1417.5k](/packages/madeitbelgium-wappalyzer)

PHPackages © 2026

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