{"id":17267985,"url":"https://github.com/bensampo/laravel-embed","last_synced_at":"2025-05-15T20:04:29.690Z","repository":{"id":42531823,"uuid":"287334175","full_name":"BenSampo/laravel-embed","owner":"BenSampo","description":"Effortless responsive embeds for videos, slideshows and more.","archived":false,"fork":false,"pushed_at":"2025-03-26T09:36:14.000Z","size":1208,"stargazers_count":138,"open_issues_count":2,"forks_count":21,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-12T16:27:16.307Z","etag":null,"topics":["embed","laravel","laravel-package","vimeo","youtube"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BenSampo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["bensampo"]}},"created_at":"2020-08-13T16:54:33.000Z","updated_at":"2025-04-26T15:24:35.000Z","dependencies_parsed_at":"2024-04-24T16:34:27.752Z","dependency_job_id":"ebecdf42-d212-4d9c-abfd-6b0b93aac412","html_url":"https://github.com/BenSampo/laravel-embed","commit_stats":{"total_commits":52,"total_committers":6,"mean_commits":8.666666666666666,"dds":0.09615384615384615,"last_synced_commit":"9cea9f6deb1599fac22752d9235a55ab9f09763f"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenSampo%2Flaravel-embed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenSampo%2Flaravel-embed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenSampo%2Flaravel-embed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenSampo%2Flaravel-embed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenSampo","download_url":"https://codeload.github.com/BenSampo/laravel-embed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414499,"owners_count":22067272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embed","laravel","laravel-package","vimeo","youtube"],"created_at":"2024-10-15T08:12:10.308Z","updated_at":"2025-05-15T20:04:23.193Z","avatar_url":"https://github.com/BenSampo.png","language":"PHP","funding_links":["https://github.com/sponsors/bensampo"],"categories":[],"sub_categories":[],"readme":"# Laravel Embed\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/BenSampo/laravel-embed/raw/master/branding/github-open-graph-image.png?sanitize=true\" alt=\"Laravel Embed\" style=\"margin-bottom: 20px\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\" style=\"margin-bottom: 20px\"\u003e\nEffortless responsive embeds for videos, slideshows and more.\u003cbr\u003e\nCreated by \u003ca href=\"https://sampo.co.uk\"\u003eBen Sampson\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://packagist.org/packages/bensampo/laravel-embed\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/bensampo/laravel-embed.svg?style=flat-square\u0026label=stable\" alt=\"Packagist Stable Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/bensampo/laravel-embed\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/bensampo/laravel-embed.svg?style=flat-square\" alt=\"Packagist downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"LICENSE.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square\" alt=\"MIT Software License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Requirements\n\n- Laravel `8` or newer\n- PHP `7.4.0` or newer\n\n## Installation\n\n### 1. Composer\n\n```bash\ncomposer require bensampo/laravel-embed\n```\n\n### 2. Include styles\n\nSomewhere inside the `\u003chead\u003e` element of the document, include:\n\n```html\n\u003cx-embed-styles /\u003e\n```\n\nIf you'd prefer to include the styles in your own CSS file, you may copy the contents of [`styles.blade.php`](https://github.com/BenSampo/laravel-embed/blob/master/resources/views/components/styles.blade.php).\n\n### 3. Publish views (optional)\n\nIf you'd like to edit any of the views you may publish them:\n\n```bash\nphp artisan vendor:publish --provider=\"BenSampo\\Embed\\EmbedServiceProvider\"\n```\n\nOnce published they can be found in `/resources/views/vendor/embed/`.\n\n## Usage\n\nSimply include the following blade component in your view making sure to pass the `url` attribute.\n\nThe `url` should be the public URL for the page you're trying to embed.\n\n```html\n\u003cx-embed url=\"https://www.youtube.com/watch?v=oHg5SJYRHA0\" /\u003e\n```\n\n### Setting the aspect ratio\n\nBy default most embedded services are shown at a ratio of `16:9`. Some services may override this if they have a more appropriate default. However, you can always change this by passing in a ratio to the `aspect-ratio` attribute.\n\n```html\n\u003cx-embed url=\"https://www.youtube.com/watch?v=oHg5SJYRHA0\" aspect-ratio=\"4:3\" /\u003e\n```\n\nThe aspect ratio is maintained at different viewport sizes.\n\n### Fallback\n\nIf no service exists to handle the URL a fallback view is rendered. You can customize this by publishing the views and editing `/resources/views/vendor/embed/services/fallback.blade.php`.\n\n### Validation\n\nA validation rule can be used to check for a supported service in a given URL.\n\n```php\nuse BenSampo\\Embed\\Rules\\EmbeddableUrl;\n\npublic function store(Request $request)\n{\n    $this-\u003evalidate($request, [\n        'url' =\u003e ['required', new EmbeddableUrl],\n    ]);\n}\n```\n\nYou may specify a list of allowed services using the `allowedServices` method.\n\n```php\nuse BenSampo\\Embed\\Services\\Vimeo;\nuse BenSampo\\Embed\\Services\\YouTube;\nuse BenSampo\\Embed\\Rules\\EmbeddableUrl;\n\npublic function store(Request $request)\n{\n    $this-\u003evalidate($request, [\n        'url' =\u003e [\n            'required',\n            (new EmbeddableUrl)-\u003eallowedServices([\n                YouTube::class,\n                Vimeo::class\n            ])\n        ],\n    ]);\n}\n```\n\n## Embed Services\n\nLaravel embed supports multiple popular embed services such as YouTube, Vimeo and Slideshare.\n\n[See the full list \u0026rarr;](https://github.com/BenSampo/laravel-embed/tree/master/src/Services)\n\nPlease submit an issue (or better yet a PR!) if the service you'd like to embed is not listed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbensampo%2Flaravel-embed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbensampo%2Flaravel-embed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbensampo%2Flaravel-embed/lists"}