staudenmeir/laravel-cte
Add Common Table Expression (CTE) support to Laravel’s query builder and Eloquent, including recursive and materialized CTEs. Works across MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, Oracle, and SingleStore. Supports Laravel 5.5+.
Laravel CTE adds Common Table Expressions (CTEs) to Laravel’s query builder and Eloquent, making it easy to write readable, composable SQL with WITH clauses. Define expressions using a query builder instance, raw SQL, or a closure, and use them seamlessly in SELECT and data-modifying queries.
Built for broad database support and multiple Laravel versions, it enables clean patterns for hierarchical queries and advanced SQL features without leaving Laravel’s fluent API.
withExpression() with builder/SQL/closure inputsHow can I help you explore Laravel packages today?