Download the PHP package waavi/model without Composer

On this page you can find all versions of the php package waavi/model. 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 model

Better Eloquent models for Laravel

WaaviModel is inspired by Ardent and Aware model validators for Eloquent. The following features are provided:

- Allows Laravel to query related models.
- AutoValidate on model save.
- Allows for unique constraint in validation rules to auto ignore the current model when updating
- Flashes input data when a save fails.

Setup

Edit composer.json:

"require": {
    "waavi/model": "dev-master"
},

Models must extend the Waavi\Model\WaaviModel class:

<?php

    use Waavi\Model\WaaviModel;

    class MyModel extends WaaviModel {

        ...

    }

Validation

WaaviModel uses Laravel's Validator class, therefore validation rules, custom messages and custom validation methods are all available.

All of Laravel's validation rules are available, as well as any custom validation rules you've setup. When saving a model, the validation is run automatically. Validation errors may be retrieved through $model->errors(). Usage example:

In case you want to skip validation, you may do so using . You may check that a model is valid before saving using

Rules may be accessed and modified at runtime using:

Custom messages are accessed in the same way:

Querying related models

WaaviModels extend Eloquent's ability to query related models. This is useful when queries must be built dynamically and require you to access values in related models.

Let us explain it through an example. Say you have the following models:

Say you want all Posts made by users named John or Jane that have been tagged as 'News'. This would be hard to do with Eloquent, but with WaaviModel you have an alternative. You may call whereRelated($relationshipName, $column, $operator, $value) to filter the results:

If you want to retrive all posts other than those posted by people named John its just as easy.

How about getting all of the post comments made in articles posted by John?

All relationships supported by Eloquent are supported by WaaviModel, including MorphOne and MorphMany. The list of available filters is:

Closures as well as deep relationships as supported, as you saw in the previous examples. However, subqueries are not yet supported, and $column, $operator and $value must be specified except when using a Closure.

Calls to whereRelated methods are internally compiled to whereIn, whereNotIn or whereNull (when no records satisfy the constraint). To do so, every call queries the database to see which records comply with the specified constraint. This has several drawbacks:

- Most common databases allow for a limited number of elements (around 10.000) in whereIn clauses. Laravel has the same limitation when using eager loading, which is done in the same way.
- Each whereRelated call queries the database separately, so heavy use will impact performance.

All versions of model with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
illuminate/support Version 4.x
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 waavi/model contains the following files

Loading the files please wait ....