Download the PHP package anthonyedmonds/laravel-db-views without Composer

On this page you can find all versions of the php package anthonyedmonds/laravel-db-views. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-db-views

laravel-db-views

Manage database views for Laravel applications

Installation

Add this library using composer require anthonyedmonds/laravel-db-views.

The service provider will be automatically registered.

Publish the config file using php artisan vendor:publish --tag=db-views"

How does this work?

You can define any number of Views by extending the View class provided in this library.

Register your View classes in the config file then run the update:db-views Artisan command to add them to your database.

Running the command will cause each registered View to be deleted and recreated fresh.

Definition

Each View consists of a name and a definition.

The name should be what you want the View to be called in the database, such as my_requests_view.

The definition should be an Eloquent or QueryBuilder query, which will have the needed view creation syntax prepended to it.

Formatters

To assist with common column formatting tasks, some helpers have been provided in the View class:

Method Usage
View::boolean($column, $as, $yes = 'Yes', $no = 'No', $null = $no) Output a boolean column in "Yes", "No", "Null" format

Using database views with Eloquent scopes

To limit results from a database view, you may wish to use an existing Eloquent scope.

A combination of whereExists() and whereColumn() will allow you to filter the result of a database view:

Testing

If your database views are not populated during migration, add the AssertsDatabaseViews trait to your TestCase class to make the useDatabaseViews() method available wherever you need it.

Configuration

Views

Register the class-string of each View to be managed by the update:db-views command.

Help and support

You are welcome to raise any issues or questions on GitHub.

If you wish to contribute to this library, raise an issue before submitting a forked pull request.

Licence

Published under the MIT licence.


All versions of laravel-db-views with dependencies

PHP Build Version
Package Version
Requires php Version ^8
illuminate/support Version ^13
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package anthonyedmonds/laravel-db-views contains the following files

Loading the files please wait ...