Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 609 Bytes

README.md

File metadata and controls

33 lines (21 loc) · 609 Bytes

WordPress Database Build Status

Installation

composer require wplibs/database:^1.0

Usage

Basic Example

<?php

use WPLibs\Database\Database;

$builder = Database::newQuery()->select( '*' )->from( 'posts' );

var_dump( $posts = $builder->get() );

var_dump( $builder->toSql() ); // select * from `{$wpdb->posts}`

The query above can be shorten by this:

$posts = Database::table( 'posts' )->get();

Documents

https://laravel.com/docs/5.4/queries