Download the PHP package stidges/laravel-db-normalizer without Composer

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

Laravel DB Normalizer

Latest Stable Version Total Downloads Build Status License

This Laravel package allows you to easily swap out your repository implementations, by providing a unified interface to your database results.

It intercepts your results and turns them into collections and entities. That way, whether you are using Eloquent, the Query Builder or any other implementation, the results will be the same!

Result

Getting Started

This package can be installed through Composer, just add it to your composer.json file:

After you have added it to your composer.json file, make sure you update your dependencies:

Next, you can do either of these two:

1. Enable auto-normalization:

By registering this package's ServiceProvider class, all the queries you run will be automatically normalized to the unified Collection and Entity classes. Add the following line to your app/config/app.php file:

When using Eloquent models, they should extend the NormalizableModel class:

2. Disable auto-normalization:

If you would rather want some more control, don't register the ServiceProvider. That way you can control when the results get cast to the classes. To do this, use the Normalizer class. Make sure you always pass an array to the normalizer!

Using the normalized results

This package provides 2 classes:

  1. A Collection class. As it currently stand, this class just extends Laravel's Illuminate\Support\Collection class.
  2. An Entity class. This class can contain nested entities and collections (relations). It provides a fluent interface to accessing the attributes of the entity, and can be cast to an array or JSON using the familiar toJson and toArray methods. On top of that, it provides a getDirtyAttributes() function, which allows you to get all the attributes that were changed after creation.

Example usage

For examples on how to use the package, please view the examples directory!

Contributing

All suggestions and pull requests are welcome! If you make any substantial changes, please provide tests along with your pull requests!

License

Copyright (c) 2014 Stidges - Released under the MIT license.


All versions of laravel-db-normalizer with dependencies

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

Loading the files please wait ....