Methods summary
public static
Laravel\Database\Connection
|
#
connection( string $connection = null )
Get a database connection.
Get a database connection.
If no database name is specified, the default connection will be
returned.
$connection = DB::connection();
$connection = DB::connection('mysql');
Parameters
- $connection
string $connection
Returns
|
protected static
PDO
|
#
connect( array $config )
Get a PDO database connection for a given database configuration.
Get a PDO database connection for a given database configuration.
Parameters
Returns
|
protected static
Laravel\Database\Connectors\Connector
|
#
connector( string $driver )
Create a new database connector instance.
Create a new database connector instance.
Parameters
Returns
|
public static
Laravel\Database\Query
|
#
table( string $table, string $connection = null )
Begin a fluent query against a table.
Begin a fluent query against a table.
Parameters
- $table
string $table
- $connection
string $connection
Returns
|
public static
Laravel\Database\Expression
|
#
raw( string $value )
Create a new database expression instance.
Create a new database expression instance.
Database expressions are used to inject raw SQL into a fluent query.
Parameters
Returns
|
public static
string
|
#
escape( string $value )
Escape a string for usage in a query.
Escape a string for usage in a query.
This uses the correct quoting mechanism for the default database
connection.
Parameters
Returns
string
|
public static
array
|
#
profile( )
Get the profiling data for all queries.
Get the profiling data for all queries.
Returns
array
|
public static
string
|
#
last_query( )
Get the last query that was executed.
Get the last query that was executed.
Returns false if no queries have been executed yet.
Returns
string
|
public static
|
#
extend( string $name, Closure $connector, Closure $query = null, Closure $schema = null )
Register a database connector and grammars.
Register a database connector and grammars.
Parameters
|
public static
|
#
__callStatic( mixed $method, mixed $parameters )
Magic Method for calling methods on the default database connection.
Magic Method for calling methods on the default database connection.
$driver = DB::driver();
$users = DB::table('users')->get();
|