- Does nwidart/laravel-videoable support Laravel 10, 11, or 12?
- No supported version range is documented beyond Laravel 5.7, which is the only framework version named in the package's 3.0.0 release notes from October 2018. Check the package's illuminate/* constraints before attempting an install on newer Laravel releases. On Laravel 10 or later, treat it as a fork-and-maintain candidate rather than a drop-in dependency unless you verify compatibility yourself.
- How do I install nwidart/laravel-videoable in a Laravel app?
- Install it with Composer using composer require nwidart/laravel-videoable, then let Laravel package auto-discovery register the service provider. Publish the package migration and run php artisan migrate to create the polymorphic videos table. Finally, add the Videoable trait to each Eloquent model that should own videos. Confirm the installed version matches your Laravel version before running the migration.
- How do I attach a YouTube or Vimeo video to an Eloquent model?
- Add the Videoable trait to the model, then use the provided videos relationship to create or associate video records. Because the relation is a standard morphMany, calls such as $post->videos()->create([...]) follow normal Eloquent behavior, with provider, URL, and embed data stored on the video record. Retrieve embed-ready URLs and thumbnails through the model's video records rather than adding columns to your posts or products table.
- Which video providers does Laravel Videoable support?
- The documented provider support is YouTube and Vimeo, with the package storing provider, URL, and embed data for those services. The overview also mentions hosted video URLs, but embed and thumbnail retrieval is described specifically for YouTube and Vimeo. If you need other providers, plan to extend the package or normalize URLs yourself.
- Is nwidart/laravel-videoable still maintained?
- The last release was 3.0.0 on 2018-10-01, and the repository has roughly 18 stars, so there is effectively no active maintainer velocity or security-fix commitment. The codebase is small, which makes reading, forking, or replacing it feasible. Treat it as an unmaintained dependency and assign an internal owner if you adopt it.
- Is Laravel Videoable safe to use in production?
- It can be, but only after a short build-versus-buy spike because the risks are maintenance-shaped rather than architectural. The trait plus migration pattern is idiomatic and has a small blast radius, but the Laravel 5.7 ceiling, dormant releases, and tiny community mean edge cases are largely untested in the wild. Read the source, verify the migration columns, and have a fork or in-house replacement plan before production use.
- How does the polymorphic video relationship work?
- The Videoable trait adds a morphMany relation from your model to the package's Video model. The videos table stores videoable_id and videoable_type, so one post, product, or other Eloquent model can own many videos while each video belongs to a single parent. This keeps video metadata out of your domain tables and lets the same video model attach to multiple model types.
- Does Laravel Videoable add a database table?
- Yes. The package ships its own migration for the polymorphic videos table, so installing it does change your database even though your domain models' schemas stay untouched. Review the migration before committing to confirm it covers provider, URL, embed data, thumbnails, and any ordering you need. If a required column is missing, you will be extending the package's schema immediately.
- Does Laravel Videoable handle cascade deletes and indexes?
- Cascade deletion and index behavior are not clearly documented, so verify both in your own spike. Polymorphic tables should have indexes on videoable_type and videoable_id for eager loading and lookups, and parent deletion should either cascade or be handled by your application. Because the community surface is tiny, test orphan cleanup and eager loading explicitly rather than assuming the package covers them.
- Should I use Laravel Videoable or build my own morphMany video trait?
- The package is essentially a trait plus a migration, so an in-house equivalent is small enough for a one-sprint spike. Choose the package if you are on a compatible Laravel version and want YouTube and Vimeo helper behavior without writing it. Build your own if you need current Laravel support, custom metadata, cascade rules, or a dependency you control.