承接 artisan-build/embeddable-links 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

artisan-build/embeddable-links

Composer 安装命令:

composer require 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.

README 文档

README

Artisan Build Package Embeddable Links Logo

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

  • 🎥 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

composer require artisan-build/embeddable-links

Configuration

Publish the configuration file (optional):

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

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

Basic Blade Component

<x-embeddable-links-embed url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" />

Custom Aspect Ratio

<x-embeddable-links-embed
    url="https://vimeo.com/123456789"
    aspect-ratio="4/3"
/>

Disable Caching

<x-embeddable-links-embed
    url="https://example.com/article"
    :cache="false"
/>

Custom Link Target

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

<x-embeddable-links-embed
    url="https://example.com/article"
    target="_self"
/>

Supported Services

YouTube:

<x-embeddable-links-embed url="https://www.youtube.com/watch?v=VIDEO_ID" />
<x-embeddable-links-embed url="https://youtu.be/VIDEO_ID" />

Vimeo:

<x-embeddable-links-embed url="https://vimeo.com/VIDEO_ID" />

GitHub Gist:

<x-embeddable-links-embed url="https://gist.github.com/username/GIST_ID" />

Any URL with OpenGraph:

<x-embeddable-links-embed url="https://laravel.com/docs" />

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

use ArtisanBuild\EmbeddableLinks\Services\EmbedManager;

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

Customization

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

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

Testing

composer test
composer test-coverage

Code Quality

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

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

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

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

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

artisan-build/embeddable-links 适用场景与选型建议

artisan-build/embeddable-links 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 365 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 artisan-build/embeddable-links 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 artisan-build/embeddable-links 我们能提供哪些服务?
定制开发 / 二次开发

基于 artisan-build/embeddable-links 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 365
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 31
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-28