Download the PHP package staudenmeir/laravel-migration-views without Composer
On this page you can find all versions of the php package staudenmeir/laravel-migration-views. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download staudenmeir/laravel-migration-views
More information about staudenmeir/laravel-migration-views
Files in staudenmeir/laravel-migration-views
Package laravel-migration-views
Short Description Laravel database migrations with SQL views
License MIT
Informations about the package laravel-migration-views
Laravel Migration Views
This Laravel extension adds support for SQL views in database migrations.
Supports Laravel 5.5+.
Installation
composer require staudenmeir/laravel-migration-views:"^1.0"
Use this command if you are in PowerShell on Windows (e.g. in VS Code):
composer require staudenmeir/laravel-migration-views:"^^^^1.0"
Versions
Laravel | Package |
---|---|
11.x | 1.9 |
10.x | 1.7 |
9.x | 1.6 |
8.x | 1.5 |
7.x | 1.4 |
6.x | 1.2 |
5.8 | 1.1 |
5.5–5.7 | 1.0 |
Usage
- Creating Views
- Renaming Views
- Dropping Views
- Checking For View Existence
- Listing View Columns
- Materialized Views
Creating Views
Use createView()
to create a view and provide a query builder instance or an SQL string:
You can provide the view's columns as the third argument:
Use createOrReplaceView()
to create a view or replace the existing one:
View Processing Algorithm
On MySQL and MariaDB, you can specify the view processing algorithm:
Renaming Views
Use renameView()
to rename a view:
Dropping Views
Use dropView()
or dropViewIfExists()
to drop a view:
If you are using php artisan migrate:fresh
, you can drop all views with --drop-views
(Laravel 5.6.26+).
Checking For View Existence
Use hasView()
to check whether a view exists:
Listing View Columns
Use getViewColumnListing()
to get the column listing for a view:
Materialized Views
On PostgreSQL, you can create a materialized view with createMaterializedView()
:
Use refreshMaterializedView()
to refresh a materialized view:
Contributing
Please see CODE OF CONDUCT for details.