• Stars
    star
    401
  • Rank 107,625 (Top 3 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An elegant lightweight and efficient SQL Query Builder with fluid interface SQL syntax supporting bindings and complicated query generation.

SQL Query Builder

Build Status Coverage Status Scrutinizer Code Quality SensioLabsInsight Latest Stable Version Total Downloads License Donate

An elegant lightweight and efficient SQL Query Builder with fluid interface SQL syntax supporting bindings and complicated query generation. Works without establishing a connection to the database.

1. Installation

The recommended way to install the SQL Query Builder is through Composer. Run the following command to install it:

php composer.phar require nilportugues/sql-query-builder

2. The Builder

The SQL Query Builder allows to generate complex SQL queries standard using the SQL-2003 dialect (default) and the MySQL dialect, that extends the SQL-2003 dialect.

2.1. Generic Builder

The Generic Query Builder is the default builder for this class and writes standard SQL-2003.

All column aliases are escaped using the ' sign by default.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()->setTable('user');    

echo $builder->write($query);    

Output:

SELECT user.* FROM user

2.2. MySQL Builder

The MySQL Query Builder has its own class, that inherits from the SQL-2003 builder. All columns will be wrapped with the tilde ` sign.

All table and column aliases are escaped using the tilde sign by default.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\MySqlBuilder;

$builder = new MySqlBuilder(); 

$query = $builder->select()->setTable('user'); 

echo $builder->write($query);    

Output:

SELECT user.* FROM `user` 

2.3. Human Readable Output

Both Generic and MySQL Query Builder can write complex SQL queries.

Every developer out there needs at some point revising the output of a complicated query, the SQL Query Builder includes a human-friendly output method, and therefore the writeFormatted method is there to aid the developer when need.

Keep in mind writeFormatted is to be avoided at all cost in production mode as it adds unneeded overhead due to parsing and re-formatting of the generated statement.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()->setTable('user');  

echo $builder->writeFormatted($query);    

Output:

SELECT 
    user.* 
FROM 
    user

More complicated examples can be found in the documentation.

3. Building Queries

3.1. SELECT Statement

3.1.1. Basic SELECT statement

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
    ->setTable('user')
    ->setColumns(['user_id','name','email']);
     
echo $builder->write($query);    

Output:

SELECT user.user_id, user.name, user.email FROM user

3.1.2. Aliased SELECT statement

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
    ->setTable('user')
    ->setColumns(['userId' => 'user_id', 'username' => 'name', 'email' => 'email']);
       
echo $builder->write($query);    

Output:

SELECT user.user_id AS 'userId', user.name AS 'username', user.email AS 'email' FROM user

3.1.3. SELECT with WHERE statement

Default logical operator for filtering using WHERE conditions is AND.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
    ->setTable('user')
    ->setColumns([
        'userId' => 'user_id',
        'username' => 'name',
        'email' => 'email'
    ])
    ->where()
    ->greaterThan('user_id', 5)
    ->notLike('username', 'John')
	->end();
      
echo $builder->writeFormatted($query);    

Output:

SELECT 
    user.user_id AS 'userId',
    user.name AS 'username',
    user.email AS 'email'
FROM 
    user 
WHERE 
    (user.user_id < :v1)
    AND (user.username NOT LIKE :v2)

3.1.4. Complex WHERE conditions

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
    ->setTable('user')
    ->where()
    ->equals('user_id', 1)
    ->equals('user_id', 2)
    ->subWhere("OR")
    ->lessThan($column, 10)
    ->greaterThan('user_id', 100)
	->end();

echo $builder->writeFormatted($query);

Output:

SELECT
    user.*
FROM
    user
WHERE
    (user.user_id = :v1)
    AND (user.user_id = :v2)
    AND (
        (user.user_id < :v3)
        OR (user.user_id > :v4)
    )

3.1.5. JOIN & LEFT/RIGHT/INNER/CROSS JOIN SELECT statements

Syntax for JOIN, LEFT JOIN, RIGHT JOIN, INNER JOIN, CROSS JOIN work the exactly same way.

Here's an example selecting both table and joined table columns and doing sorting using columns from both the table and the joined table.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
    ->setTable('user')
    ->setColumns([
            'userId'   => 'user_id',
            'username' => 'name',
            'email'    => 'email',
            'created_at'
    ])
    ->orderBy('user_id', OrderBy::DESC)
    ->leftJoin(
        'news', //join table
        'user_id', //origin table field used to join
        'author_id', //join column
         ['newsTitle' => 'title', 'body', 'created_at', 'updated_at']
     )
    ->on()
    ->equals('author_id', 1); //enforcing a condition on the join column

$query
    ->where()
    ->greaterThan('user_id', 5)
    ->notLike('username', 'John')
	->end();

$query
    ->orderBy('created_at', OrderBy::DESC);

echo $builder->writeFormatted($query); 

Output:

SELECT 
    user.user_id AS 'userId',
    user.name AS 'username',
    user.email AS 'email',
    user.created_at,
    news.title AS 'newsTitle',
    news.body,
    news.created_at,
    news.updated_at 
FROM 
    user 
LEFT JOIN 
        news
    ON 
        (news.author_id = user.user_id) 
        AND (news.author_id = :v1)
WHERE 
    (user.user_id < :v2)
    AND (user.username NOT LIKE :v3)        
ORDER BY 
    user.user_id DESC,
    news.created_at DESC;

3.1.6. COUNT rows

Counting rows comes in 3 possible ways, using the ALL selector *, stating a column or stating a column and its alias.

3.1.6.1. Count using ALL selector

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
        ->setTable('user')
        ->count()

echo $builder->write($query);

Output:

SELECT COUNT(*) FROM user;

3.1.6.2. Count using column as a selector

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
        ->setTable('user')
        ->count('user_id')

echo $builder->write($query);

Output:

SELECT COUNT(user.user_id) FROM user;

3.1.6.3. Count using column as a selector

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
        ->setTable('user')
        ->count('user_id', 'total_users')

echo $builder->write($query);

Output:

SELECT COUNT(user.user_id) AS 'total_users' FROM user;

3.2. INSERT Statement

The INSERT statement is really straightforward.

3.2.1 Basic INSERT statement

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->insert()
    ->setTable('user')
    ->setValues([
        'user_id' => 1,
        'name'    => 'Nil',
        'contact' => '[email protected]',
    ]);
   
$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output

INSERT INTO user (user.user_id, user.name, user.contact) VALUES (:v1, :v2, :v3)
[':v1' => 1, ':v2' => 'Nil', ':v3' => '[email protected]'];

3.3. UPDATE Statement

The UPDATE statement works just like expected, set the values and the conditions to match the row and you're set.

Examples provided below.

3.3.1 Basic UPDATE statement

Important including the the where statement is critical, or all table rows will be replaced with the provided values if the statement is executed.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->update()
    ->setTable('user')
    ->setValues([
        'user_id' => 1,
        'name' => 'Nil',
        'contact' => '[email protected]'
    ])
    ->where()
    ->equals('user_id', 1)
	->end();

$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output:

UPDATE 
    user 
SET
    user.user_id = :v1,
    user.name = :v2, 
    user.contact = :v3
WHERE 
    (user.user_id = :v4)
[':v1' => 1, ':v2' => 'Nil', ':v3' => '[email protected]', ':v4' => 1];

3.3.2. Elaborated UPDATE statement

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Syntax\OrderBy;
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->update()
    ->setTable('user')
    ->setValues([
        'name' => 'UpdatedName',
    ]);
    
$query
    ->where()
    ->like('username', '%N')
    ->between('user_id', 1, 2000)
	->end();
        
$query
    ->orderBy('user_id', OrderBy::ASC)
    ->limit(1);            
   
$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output:

UPDATE 
    user 
SET 
    user.name = :v1
WHERE 
    (user.username LIKE :v2) 
    AND (user.user_id BETWEEN :v3 AND :v4)
ORDER BY 
    user.user_id ASC 
LIMIT :v5

3.4. DELETE Statement

The DELETE statement is used just like UPDATE, but no values are set.

Examples provided below.

3.4.1. Empty table with DELETE statement

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->delete()
    ->setTable('user');
   
$sql = $builder->write($query);   

Output:

DELETE FROM user

3.4.2. Basic DELETE statement

Important including the the where statement is critical, or all table rows will be deleted with the provided values if the statement is executed.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->delete()
    ->setTable('user');

$query
    ->where()
    ->equals('user_id', 100)
	->end();

$query
    ->limit(1);
   
$sql = $builder->write($query);    
$values = $builder->getValues();

Output:

DELETE FROM user WHERE (user.user_id = :v1) LIMIT :v2
[':v1' => 100, ':v2' => 1];

3.4.2. Elaborated DELETE statement

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Syntax\OrderBy;
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->delete()
    ->setTable('user');
    
$query
    ->where()
    ->like('username', '%N')
    ->between('user_id', 1, 2000)
	->end();
        
$query
    ->orderBy('user_id', OrderBy::ASC)
    ->limit(1);            
   
$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output:

DELETE FROM 
    user 
WHERE 
    (user.username LIKE :v1) 
    AND (user.user_id BETWEEN :v2 AND :v3)
ORDER BY 
    user.user_id ASC 
LIMIT :v4

3.5. INTERSECT Statement


INTERSECT is not supported by MySQL. Same results can be achieved by using INNER JOIN statement instead.


The INTERSECT statement is really straightforward.

3.5.1 Basic INTERSECT statement

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$select1 = $builder->select()->setTable('user');
$select2 = $builder->select()->setTable('user_emails');
   
$query = $builder->intersect()
    ->add($select1)
    ->add($select2);
   
$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output

SELECT user.* FROM user
INTERSECT
SELECT user_email.* FROM user_email

3.6. MINUS Statement


MINUS is not supported by MySQL. Same results can be achieved by using a LEFT JOIN statement in combination with an IS NULL or NOT IN condition instead.


The MINUS statement is really straightforward.

3.6.1 Basic MINUS statement

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$select1 = $builder->select()->setTable('user');
$select2 = $builder->select()->setTable('user_emails');
   
$query = $builder->minus($select1, $select2);
   
$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output

SELECT user.* FROM user
MINUS
SELECT user_email.* FROM user_email

3.7. UNION Statement

The UNION statement is really straightforward.

3.7.1 Basic UNION statement

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$select1 = $builder->select()->setTable('user');
$select2 = $builder->select()->setTable('user_emails');
   
$query = $builder->union()
    ->add($select1)
    ->add($select2);
   
$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output

SELECT user.* FROM user
UNION
SELECT user_email.* FROM user_email

3.8. UNION ALL Statement

The UNION ALL statement is really straightforward.

3.8.1 Basic UNION ALL statement

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$select1 = $builder->select()->setTable('user');
$select2 = $builder->select()->setTable('user_emails');
   
$query = $builder->unionAll()
    ->add($select1)
    ->add($select2);
   
$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output

SELECT user.* FROM user
UNION ALL
SELECT user_email.* FROM user_email

4. Advanced Quering

4.1. Filtering using WHERE

The following operators are available for filtering using WHERE conditionals:

public function subWhere($operator = 'OR');
public function equals($column, $value);        
public function notEquals($column, $value);
public function greaterThan($column, $value);
public function greaterThanOrEqual($column, $value);
public function lessThan($column, $value);
public function lessThanOrEqual($column, $value);
public function like($column, $value);
public function notLike($column, $value);
public function match(array $columns, array $values);
public function matchBoolean(array $columns, array $values);
public function matchWithQueryExpansion(array $columns, array $values);
public function in($column, array $values);
public function notIn($column, array $values);
public function between($column, $a, $b);
public function notBetween($column, $a, $b);
public function isNull($column);
public function isNotNull($column);
public function exists(Select $select);
public function notExists(Select $select);
public function addBitClause($column, $value);    
public function asLiteral($literal);

4.2. Changing WHERE logical operator

WHERE default's operator must be changed passing to the where method the logical operator OR.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
    ->setTable('user')
    ->where('OR')
    ->equals('user_id', 1)
    ->like('name', '%N%')
	->end();       
   
$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output:

SELECT user.* FROM user WHERE (user.user_id = :v1) OR (user.name LIKE :v2)

4.3. Grouping with GROUP BY and HAVING

Default logical operator for joining more than one HAVING condition is AND.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
    ->setTable('user')
    ->setColumns([
        'userId'   => 'user_id',
        'username' => 'name',
        'email'    => 'email',
        'created_at'
    ])
    ->groupBy(['user_id', 'name'])
    ->having()
    ->equals('user_id', 1)
    ->equals('user_id', 2);
   
$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output:

SELECT 
    user.user_id AS 'userId',
    user.name AS 'username',
    user.email AS 'email',
    user.created_at 
FROM 
    user 
GROUP BY 
    user.user_id, user.name 
HAVING 
    (user.user_id = :v1)
    AND (user.user_id = :v2)

4.3.1 Available HAVING operators

Same operators used in the WHERE statement are available for HAVING operations.

4.4. Changing HAVING logical operator

HAVING default's operator must be changed passing to the having method the logical operator OR.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
    ->setTable('user')
    ->setColumns([
        'userId'   => 'user_id',
        'username' => 'name',
        'email'    => 'email',
        'created_at'
    ])
    ->groupBy(['user_id', 'name'])
    ->having('OR')
    ->equals('user_id', 1)
    ->equals('user_id', 2);
   
$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output:

SELECT 
    user.user_id AS 'userId',
    user.name AS 'username',
    user.email AS 'email',
    user.created_at 
FROM 
    user 
GROUP BY 
    user.user_id, user.name 
HAVING 
    (user.user_id = :v1)
    OR (user.user_id = :v2)

4.5. Columns as SELECT statements

Sometimes, a column needs to be set as a column. SQL Query Builder got you covered on this one too! Check the example below.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$selectRole = $builder->select()
    ->setTable('role')
    ->setColumns(array('role_name'))
    ->limit(1)
    ->where()
    ->equals('role_id', 3);

$query = $builder->select()
    ->setTable('user')
    ->setColumns(array('user_id', 'username'))
    ->setSelectAsColumn(array('user_role' => $selectRole))
    ->setSelectAsColumn(array($selectRole))
    ->where()
    ->equals('user_id', 4)
	->end();
   
$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output:

SELECT 
    user.user_id,
    user.username,
    (
        SELECT 
            role.role_name 
        FROM 
            role 
        WHERE 
            (role.role_id = :v1) 
        LIMIT :v2, :v3
    ) AS 'user_role', 
    (
        SELECT 
            role.role_name  
        FROM 
            role 
        WHERE 
            (role.role_id = :v4) 
        LIMIT :v5, :v6
    ) AS 'role' 
FROM 
    user 
WHERE 
    (user.user_id = :v7)

4.6. Columns being Values

There are time where you need to force the same column structure (eg: UNIONs) even when lacking of a column or value. Forcing column with values gets you covered.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
    ->setTable('user')
    ->setColumns(array('user_id', 'username'))
    ->setValueAsColumn('10', 'priority')
    ->where()
    ->equals('user_id', 1)
	->end();
   
$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output:

SELECT 
    user.user_id,
    user.username,
    :v1 AS 'priority' 
FROM 
    user 
WHERE
    (user.user_id = :v2)

4.7. Columns using FUNCTIONS

Example for MAX function.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
    ->setTable('user')
    ->setColumns(array('user_id', 'username'))
    ->setFunctionAsColumn('MAX', array('user_id'), 'max_id')
    ->where()
    ->equals('user_id', 1)
	->end(); 
   
$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output:

SELECT 
    user.user_id,
    user.username,
    MAX(user_id) AS 'max_id'
FROM 
    user
WHERE
    (user.user_id = :v1)

Example for CURRENT_TIMESTAMP function.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
    ->setTable('user')
    ->setColumns(array('user_id', 'username'))
    ->setFunctionAsColumn('CURRENT_TIMESTAMP', array(), 'server_time')
    ->where()
    ->equals('user_id', 1)
	->end();
   
$sql = $builder->writeFormatted($query);    
$values = $builder->getValues();

Output:

SELECT 
    user.user_id,
    user.username,
    CURRENT_TIMESTAMP AS 'server_time' 
FROM 
    user 
WHERE
    (user.user_id = :v1)

5. Commenting queries

The query builder allows adding comments to all query methods by using the setComment method.

Some useful use cases examples can be :

  • Explain difficult queries or why of its existence.
  • Finding slow queries from its comments.

Usage:

<?php
use NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder;

$builder = new GenericBuilder(); 

$query = $builder->select()
    ->setTable('user')
    ->setComment('This is a comment');
    
$sql = $builder->write($query);   

Output:

-- This is a comment
SELECT user.* FROM user

6. Quality Code

Testing has been done using PHPUnit and Travis-CI. All code has been tested to be compatible from PHP 5.4 up to PHP 5.6 and HHVM.

To run the test suite, you need Composer:

    php composer.phar install --dev
    php bin/phpunit

7. Author

Nil Portugués Calderó

8. License

SQL Query Builder is licensed under the MIT license.

Copyright (c) 2014 Nil Portugués Calderó

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

More Repositories

1

laravel5-jsonapi

Laravel 5 JSON API Transformer Package
PHP
310
star
2

symfony-jsonapi

JSON API Transformer Bundle for Symfony 2 and Symfony 3
PHP
114
star
3

php-backslasher

[Git hook] Tool to add all PHP internal functions and constants to its namespace by adding backslash to them.
PHP
87
star
4

php-json-api

JSON API transformer outputting valid (PSR-7) API Responses.
PHP
68
star
5

php-serializer

Serialize PHP variables, including objects, in any format. Support to unserialize it too.
PHP
48
star
6

php-sitemap

Standalone sitemap builder 100% standards compliant.
PHP
48
star
7

react-jsonschema-form-semanticui

A React component for building forms from JSON Schema with Semantic UI
JavaScript
45
star
8

sql-repository

[PHP 7] SQL Repository implementation
PHP
36
star
9

php-sql-query-formatter

A very lightweight PHP class that re-formats unreadable or computer-generated SQL query statements to human-friendly readable text.
PHP
36
star
10

laravel5-jsonapi-dingo

Laravel5 JSONAPI and Dingo together to build APIs fast
PHP
30
star
11

php-hal

HAL+JSON & HAL+XML API transformer outputting valid (PSR-7) API Responses.
PHP
30
star
12

php-schema.org-mapping

A fluent interface to create mappings using Schema.org for Microdata and JSON-LD.
PHP
30
star
13

php-xml

XML transformer outputting valid (PSR-7) API Responses.
PHP
22
star
14

php-sphinx-search

Sphinx for PHP 5.3 and above. Fully PHPUnit tested.
PHP
19
star
15

eloquent-mongodb-repository

Eloquent MongoDB Repository Implementation
PHP
18
star
16

eloquent-repository

Eloquent Repository implementation
PHP
17
star
17

php-api-problems

PSR7 Response implementation for the Problem Details for HTTP APIs
PHP
17
star
18

plans

Laravel Plans is a package for SaaS-like apps that need easy management over plans, features and event-driven updates on plans and subscriptions.
PHP
16
star
19

laravel5-hal-json

Laravel 5 HAL+JSON API Transformer Package
PHP
15
star
20

php-todo-finder

[Git hook] Do not allow commits if the total amount of to-do increased or is above a user-defined threshold.
PHP
12
star
21

php-validator

A powerful and elegant stand-alone validation library with no dependencies.
PHP
12
star
22

php-forbidden-functions

[Git hook] Command line to look for functions that should be avoided
PHP
10
star
23

mongodb-repository

[PHP 7] MongoDB Repository implementation
PHP
9
star
24

symfony-hal-json

HAL+JSON API Transformer Bundle for Symfony 2 and Symfony 3
PHP
9
star
25

php-api-transformer

Base library providing the core functionality for API transformation.
PHP
9
star
26

php-assert

A simple and elegant assertion library for input validation.
PHP
9
star
27

repository-cache

[PHP 7] Repository with Cache layer using PSR-6
PHP
7
star
28

php-cache

Cache layer for PHP applications capable of being used standalone or with the Chain of Responsability pattern.
PHP
7
star
29

laravel5-jsend

Laravel 5 JSend API Transformer Package
PHP
5
star
30

php-uuid

Use this class to encapsulate the latest and more secure Uuid versions
PHP
5
star
31

php-json

JSON transformer outputting valid (PSR-7) API Responses.
PHP
4
star
32

filesystem-repository

[PHP 7] FileSystem Repository implementation
PHP
4
star
33

serializer-eloquent-driver

Driver for the Serializer library caring of Eloquent ORM model serialization
PHP
4
star
34

twig-macros-boilerplate

Twig macros as building blocks
HTML
3
star
35

laravel5-json

Laravel 5 JSON Transformer Package
PHP
3
star
36

docker-nginx_php7

nginx + PHP7 Docker
Nginx
3
star
37

docker

Docker setup for most of my projects
Perl
2
star
38

docker-jenkins

Jenkins + PHP7 + NodeJS
Shell
2
star
39

php-jsend

JSend API transformer outputting valid (PSR-7) API Responses.
PHP
2
star
40

php-namespace-checker

[WIP][Git hook] Looks into composer.json autoload and checks files for namespace mismatches.
PHP
2
star
41

websocket-react-example

Example on how to run Socket.io and ReactJS
JavaScript
2
star
42

python3-docker-flask-uwsgi

Example repo for a Python Flask application using Docker with Nginx & uWSGI
Python
2
star
43

docker-ansistrano

Ansistrano Docker
Shell
1
star
44

graphql-data-access-generator

Generate all queries, mutation, subscriptions, fragments and types for any GraphQL schema
TypeScript
1
star