Download the PHP package centamiv/concrete without Composer
On this page you can find all versions of the php package centamiv/concrete. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download centamiv/concrete
More information about centamiv/concrete
Files in centamiv/concrete
Package concrete
Short Description A simple and solid ORM for PHP applications.
License MIT
Informations about the package concrete
Concrete ORM
Concrete is a simple and solid ORM for PHP applications. It provides an elegant Active Record implementation and a fluent Query Builder to interact with your database.
Installation
Configuration
Initialize the database connection once, typically in your bootstrap file.
MySQL
SQLite
PostgreSQL
SQL Server
Defining Models
Extend Concrete\Model and declare the TABLE constant. The primary key defaults to id.
Custom & Composite Primary Keys
CRUD
Create
Read
Update
Delete
Query Builder
Access the builder via Model::query().
Filtering
where
Supported operators: = != <> < > <= >= LIKE NOT LIKE IN NOT IN IS IS NOT
whereIn / whereNotIn
Pass a plain array or a subquery Builder as the second argument.
An empty array in
whereIngenerates1 = 0(always false); inwhereNotInit generates1 = 1(always true).
whereExists / whereNotExists
whereColumn
Compare two column identifiers without parameterization — used for correlated subqueries.
Supported operators: = != <> < > <= >=
Ordering
Joins
Conditional Selection — CASE
Build CASE WHEN … THEN … ELSE … END expressions with When. Pass them directly to select().
Result type rules for then() / else():
| PHP type | SQL |
|---|---|
int / float |
embedded literal (1, 3.14) |
null |
NULL literal |
string |
bound as PDO named parameter |
Scalar Subqueries in select()
Use Subquery to embed a correlated scalar subquery as a column.
UNION
Combine the results of two or more queries with union() (distinct rows) or unionAll() (all rows including duplicates).
orderBy(), take(), and skip() called on the outermost builder apply to the whole union result.
Limiting Results
Aggregates & Helpers
Bulk Update & Delete via Builder
Raw Arrays
Use getRows() / firstRow() to retrieve plain associative arrays instead of model instances.
Advanced
Inspecting the Generated SQL
Raw PDO Queries
Standalone Builder
Requirements
- PHP >= 7.4
ext-pdo- For MySQL:
ext-pdo_mysql - For SQLite:
ext-pdo_sqlite - For PostgreSQL:
ext-pdo_pgsql - For SQL Server:
ext-pdo_sqlsrv
Laravel Integration
Reuse an existing Laravel PDO connection via initFromPDO.
Then use Concrete models alongside Eloquent in your controllers.
License
MIT
All versions of concrete with dependencies
ext-pdo Version *