Download the PHP package ceddyg/query-builder-repository without Composer

On this page you can find all versions of the php package ceddyg/query-builder-repository. 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 query-builder-repository

Query Builder Repository

Laravel Repository using Query Builder (Fluent) instead of Eloquent. It returns a Collection of StdClass or a simple StdClass. It can receive arrays to create or update a record in the database and also delete a record or multiple record.

Installation

Usage

Create a repository

Firstly you have to create a repository and define the table, primary key and fillable.

By default the table will take the snake case in the plural of the repository's name without "Repository" and primary key is "id" by default.

Avaible methods

Additional methods

all

Get all record in the database.

find

Find a record with his ID.

findByField

Find records with a given field.

findWhere

Find records with a given where clause.

findWhereIn

Find records with a given where in clause.

findWhereNotIn

Find records with a given where not in clause.

first

Return the first record.

php $oRepository = new ProductRepository();

$oRepository->last(); //StdClass //or $oRepository->last(['name']); //StdClass html

ID Name Price Category Tag Tag Category

javascript $(document).ready(function() { $('#tab-admin').DataTable({ serverSide: true, ajax: { url: '../ajax-url' }, columns: [ { data: "id" }, { data: "name" }, { data: "price" }, { data: "category_name", name: "category.name" }, { data: "tag_name", name: "tag.name", //If you have many tag and want to replace ' / ' render: function ( data, type, row, meta ) { return data.replace(" / ", "
"); ; } }, { data: "category_tag_name", name: "tag.category_tag.name" }, //Add a button to edit { data: "id",
render: function ( data, type, row, meta ) {

                var render = "{!! Button::warning('Edit')->asLinkTo(route('admin.admin.edit', 'dummyId'))->extraSmall()->block()->render() !!}";
                render = render.replace("dummyId", data); 

                return render;
            }
        },
        //Add a button to delete
        { 
            data: "id",  
            render: function ( data, type, row, meta ) {

                var render = '{!! BootForm::open()->action( route("admin.admin.destroy", "dummyId") )->attribute("onsubmit", "return confirm(\'Are you sure to delete ?\')")->delete() !!}'
                    +'{!! BootForm::submit("Delete", "btn-danger")->addClass("btn-block btn-xs") !!}'
                    +'{!! BootForm::close() !!}';
                render = render.replace("dummyId", data); 

                return render;
            } 
        }
    ],
    //Don't sort edit and delete column
    aoColumnDefs: [
        {
            bSortable: false,
            aTargets: [ -1, -2 ]
        }
    ]
});

} );



#### orderBy

Order by a given field and direction. By defalut, the direction is 'asc'.

#### limit

Limit the query.

## Timestamp

You can automatically set a timestamp to a record.

## Date

You can specify the default date format from the database and the default date format to store in the database.

Then if you have 2017-05-24 in your database you will have :

## Custom attribute

You can get specific attribute.

And you can use it simply.

You can specify what column you need for your custom attribute in the class.

And then.

## Relationship

To configure relationship, it's like Eloquent, you have to define a belongsTo, belongsToMany or hasMany with other repositories.

Relations are considered like columns, so to add it :

To use it with [getFillFromView](#getfillfromview) you have to define what relations you allow :

You can specify if the relations are returned as array or collection.

## Connection

You can specify a database (set in config/database.php).

Or

## ToDo List

- Add specific setter
- Select only the fillable's relation in the getFillFromView method (if we have $oItem->tag->tag_name in the view, the system have to select tag_name only)
- Add through relation
- Mix paginate and avaible methods
- Add a command to generate repository

All versions of query-builder-repository with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version ~5.1|^6.0
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 ceddyg/query-builder-repository contains the following files

Loading the files please wait ....