Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Migration Views Laravel Package

staudenmeir/laravel-migration-views

Laravel Migration Views adds createView and dropView macros to Laravel's schema Blueprint, letting you create and drop database views directly in migrations alongside your tables. Supports MySQL, PostgreSQL, SQLite and SQL Server.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package is a thin extension of Laravel's schema builder — Schema::createView(), createOrReplaceView(), dropView(), and rename — emitted as ordinary DDL inside ordinary migration files. For a Laravel application where php artisan migrate is already the single source of truth for schema, this is the lowest-friction place a database view can live: it inherits versioning, code review, CI execution, and rollback for free. The best-fit use cases are reporting read models shared by several Eloquent models or a BI connection, denormalized export surfaces, and compatibility shims over legacy tables during a refactor. It fits poorly where a DBA or platform team owns schema changes through separate tooling, or where views logically belong to a warehouse/BI platform rather than the application database. As a TPM, treat "fit" as a governance question first and a technical one second: adopting this creates a second path to schema change unless the migration pipeline is already uncontested.

Integration feasibility. High and cheap. Composer require, auto-discovered service provider, no config to publish, one migration file to prove it out. MySQL, PostgreSQL, SQLite, and SQL Server are covered, which is the realistic production/CI matrix. v1.12 is a compatibility-only release — Laravel 13 support, no API changes, no deprecations, no breaking changes — so for a team planning a Laravel 13 upgrade this is a checklist item cleared at near-zero cost, not a feature bet. The low opportunity score (~38) is consistent with that read: the package removes friction, it does not open new product surface. Fund it as a hygiene line item, not a roadmap initiative.

Technical risk. Low for the release, moderate for the pattern. The release is a constraint bump. The pattern carries the real exposure: view dependency ordering inside the migration timeline, database permissions for CREATE/DROP VIEW in each environment, rollback correctness (an orphaned view silently shadowing a table name produces confusing failures on the next deploy, not this one), cross-engine SQL dialect divergence, and whether php artisan schema:dump / restore round-trips views faithfully. None of these are exotic, but each has a plausible production failure path, and each is cheap to test and expensive to discover.

Key questions to resolve before committing a roadmap slot.

  • Scope ambiguity — are materialized views in scope? The package description lists only standard views; internal assessment material references PostgreSQL materialized-view macros with manual REFRESH MATERIALIZED VIEW CONCURRENTLY. This is a material discrepancy for any dashboarding workstream: if materialized views are covered, they arrive with an unevaluated refresh lifecycle; if not, that lifecycle is a separate design with a separate owner. Resolve against the README and source before scoping.
  • What Laravel/PHP floor does the v1.12 constraint set impose, and does it exclude anyone currently on the fleet? That is the actual gate on the upgrade program, not the package API.
  • Which engines run in production, CI, and local dev — and are they the same? A SQLite test suite against PostgreSQL production will diverge specifically on views.
  • Do views already exist outside migrations, and who owns them today? That answer determines whether adoption is net simplification or a governance conflict.
  • Does a 226-star, single-maintainer, zero-dependent community package meet our dependency support policy? Zero dependents is a discoverability signal, not a quality signal — but it does mean there is no ecosystem pressure keeping it maintained.
  • Is Laravel 13 landing this cycle, next, or undecided? That decides whether v1.12 is actionable work or merely reassurance.

Integration Approach

Stack fit. Introduce it where views are already part of application schema and already depended on by more than one consumer. The ceremony of a migration file is repaid the first time a report definition changes and someone has to prove what changed. Skip it for throwaway or single-consumer views.

Migration path. Inventory first: which views live in hand-written SQL, which live in deploy runbooks, which exist only in production and were never written down. Convert opportunistically — one low-risk reporting view, then the next — never as a big-bang rewrite. Establish conventions before the second migration exists, because they are far harder to retrofit than to set: one migration per view, created after the tables it selects from, with a matching down(). Changes to an existing view get a new migration; never edit an applied one. Note the PostgreSQL constraint that CREATE OR REPLACE VIEW cannot change a view's output column list — that requires drop-and-recreate plus re-granting permissions — so treat view column names as a stable public contract. Avoid select * in view bodies so base-table changes fail loudly at migration time rather than silently reshaping the view.

Compatibility. The gate is the application's Laravel/PHP constraint set plus the database engine's treatment of views, not the package API. Driver support is uneven in practice: plain views span all four engines; materialized views, if present at all, are PostgreSQL-only and will break an SQLite CI suite unless explicitly guarded. Record both facts in the compatibility matrix so nobody rediscovers them during an upgrade.

Sequencing.

  1. Spike on a non-production branch against the target Laravel version and the production database engine.
  2. Land one representative view migration plus a rollback test in CI; verify schema dump/restore round-trips the view.
  3. Convert one low-risk production view through a normal release; watch both the deploy and the rollback path.
  4. Codify conventions (naming, dependency ordering, ownership, rollback expectation) in an example migration in-repo.
  5. Roll out to remaining views; update the dependency register and compatibility matrix; mark Laravel 13 cleared against this package.

Operational Impact

Maintenance. Small footprint, single maintainer, pinned version. Include the package in every Laravel upgrade test pass and read release notes on bump. v1.12 is a routine compatibility release — a positive maintenance signal, not an operational change. The real long-term cost is not the package but the view definitions themselves, which accumulate and each need an owner. Assign ownership per view at creation time, or the reporting layer becomes tribal knowledge again with cleaner tooling.

Support. Set expectations that behavior depends on the database and on Laravel's schema builder, not on the package alone. Internal ownership must cover migration review and rollback procedure; there is no vendor to escalate to. The exit cost is genuinely low — view migrations are plain SQL and can be reimplemented with DB::statement — but write that fallback down before you need it, and note that dropping the package does not drop the views.

Scaling. Views scale with the query planner, not with this package. The scaling risk is organizational: as the view count grows, so does the dependency graph inside the migration timeline, and a single misordered or orphaned view can block the deploy path for everything behind it. Keep view migrations small, named predictably, and ordered after their dependencies; treat the migration file as the unit of review.

Failure modes to design against. Orphaned views shadowing table names after a partial rollback; missing CREATE/DROP VIEW grants in a new environment; dialect divergence between CI (often SQLite) and production (often PostgreSQL or MySQL); schema dump/restore quietly omitting a view and producing a green build against an incomplete schema; and silently widened views from select * after a base-table change. Each maps to one cheap guard: a rollback test, a permissions check in environment provisioning, a production-engine CI job for view migrations, a dump/restore round-trip assertion, and a lint rule against select *.

Ramp-up. Near zero for anyone who has written a Laravel migration — the API surface is four methods and the learning is in the conventions, not the code. Budget the onboarding cost at a short written convention note plus one example migration in-repo, and expect the first converted view to take an afternoon and the second to take an hour.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core