webwizardsusa / laravel-oembed
oEmbed for Laravel: turn YouTube, Vimeo, X and other URLs into safe embeds, with optional oEmbed discovery and Filament fields.
Requires
- php: ^8.3
- illuminate/cache: ^12.0 || ^13.0
- illuminate/console: ^12.0 || ^13.0
- illuminate/contracts: ^12.0 || ^13.0
- illuminate/database: ^12.0 || ^13.0
- illuminate/http: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
- illuminate/view: ^12.0 || ^13.0
- spatie/laravel-package-tools: ^1.92
Requires (Dev)
- filament/filament: ^5.0
- orchestra/testbench: ^11.0
- pestphp/pest: ^5.2
- pestphp/pest-plugin-laravel: ^5.0
Suggests
- filament/filament: For the OEmbedInput form field, OEmbedEntry infolist entry and OEmbedColumn table column.
Provides
None
Conflicts
None
Replaces
None
README
Under active development. This package is still changing and may not be ready for production use yet. Breaking changes only come in major releases, so check the changelog before you upgrade across one.
Turn YouTube, Vimeo, X and other URLs into embeds in Laravel, safely. The provider's HTML is never output as it came: players are rebuilt from the provider's own hosts, posts from their text and links, and anything else shows as a link. Answers are kept in swappable stores (the cache, a database table, or your own), optional oEmbed discovery handles other sites behind a guard that keeps lookups off private networks, and with Filament you also get a form field, an infolist entry and a table column.
Requires PHP 8.3+ and Laravel 12 or 13. Filament 5 is optional.
composer require webwizardsusa/laravel-oembed
<style>{!! OEmbed::stylesheet() !!}</style> <x-oembed :url="$post->video_url" caption="Watch this" />
use Webwizardsusa\OEmbed\Facades\OEmbed; use Webwizardsusa\OEmbed\Filament\Forms\Components\OEmbedInput; OEmbed::privacyEnhancedYouTube()->render('https://www.youtube.com/watch?v=dQw4w9WgXcQ'); OEmbedInput::make('video_url')->required();
Documentation
Read the full documentation in the docs folder.
About Us
This package is developed and maintained by WebWizardsUSA, a top rated web development agency on Upwork.
License
The MIT License (MIT). See LICENSE.md.