Download the PHP package shiftonelabs/laravel-db-events without Composer

On this page you can find all versions of the php package shiftonelabs/laravel-db-events. 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-events

laravel-db-events

Latest Version on Packagist Build Status Coverage Status Quality Score Total Downloads

This Laravel/Lumen package provides additional events for the Illuminate Database package. Currently, this package adds:

Additional events may be added be added as requested/submitted.

Install

Via Composer

Once composer has been updated and the package has been installed, the service provider will need to be loaded.

For Laravel 4, open app/config/app.php and add following line to the providers array:

For Laravel 5, open config/app.php and add following line to the providers array:

For Lumen 5, open bootstrap/app.php and add following line under the "Register Service Providers" section:

Usage

DatabaseConnecting Event

The ShiftOneLabs\LaravelDbEvents\Extension\Database\Events\DatabaseConnecting event allows you to hook into the database connection lifecycle before the connection is established. Additionally, this event provides you the ability to modify the configuration used for the connection, as well as completely cancel the connection attempt.

Attributes

The DatabaseConnecting event provides three public attributes:

Attribute Description
public $connector The Connector object making the connection. This package extends each of the built-in connectors.
public $connectionName The name of the selected database connection configuration.
public $config The configuration array used to connect to the database.

Example:

Modifying Connection Configuration

The configuration for your database connections is usually stored in your config/database.php file (in conjunction with your .env file). If, however, you need to dynamically modify the configuration used for the connection, this can be done inside a DatabaseConnecting event listener. Any changes made to the configuration in the event listener will be used for the database connection.

Example:

Cancelling the Connection

There may be situations where you would like to prevent the database from attempting the connection. In this case, the database connection attempt can be cancelled by returning false from a DatabaseConnecting event listener. If the database connection is cancelled, a ShiftOneLabs\LaravelDbEvents\Exceptions\ConnectingException runtime exception will be thrown.

Example:

DatabaseConnected Event

The ShiftOneLabs\LaravelDbEvents\Extension\Database\Events\DatabaseConnected event allows you to hook into the database connection lifecycle after the connection is established. Additionally, this event provides access to the final configuration used for the connection, as well as the connection itself.

Attributes

The DatabaseConnected event provides four public attributes:

Attribute Description
public $connector The Connector object making the connection. This package extends each of the built-in connectors.
public $connectionName The name of the selected database connection configuration.
public $config The configuration array that was used to connect to the database.
public $pdo The connected PDO (or potentially Doctrine\DBAL\Driver\PDOConnection, as of 5.3) object.

Example:

Contributing

Contributions are very welcome. Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-db-events with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/database Version >=4.1
illuminate/support Version >=4.1
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 shiftonelabs/laravel-db-events contains the following files

Loading the files please wait ....