PHPackages                             atldays/laravel-sculptor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. atldays/laravel-sculptor

ActiveLibrary[Database &amp; ORM](/categories/database)

atldays/laravel-sculptor
========================

This package provides a convenient interface for building complex database queries using Eloquent ORM in Laravel.

v1.0.0(1mo ago)00MITPHPPHP ^8.2CI passing

Since Apr 14Pushed 1mo agoCompare

[ Source](https://github.com/atldays/laravel-sculptor)[ Packagist](https://packagist.org/packages/atldays/laravel-sculptor)[ Docs](https://github.com/atldays/laravel-sculptor)[ RSS](/packages/atldays-laravel-sculptor/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (12)Versions (3)Used By (0)

Laravel Sculptor
================

[](#laravel-sculptor)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1c05b9db5ee4f4b6bddeff97b7c3bf43f779889545b7d45edaf46d464bfe52db/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61746c646179732f6c61726176656c2d7363756c70746f722e7376673f6c6f676f3d7061636b6167697374267374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/atldays/laravel-sculptor)[![Total Downloads](https://camo.githubusercontent.com/50817c9f58a229d48a72cc5071b521bcbbfa00b83dadaf1330666e05b84c5377/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61746c646179732f6c61726176656c2d7363756c70746f722e7376673f7374796c653d666f722d7468652d626164676526636f6c6f723d626c7565)](https://packagist.org/packages/atldays/laravel-sculptor)[![CI](https://camo.githubusercontent.com/5881fc83d61720c10a724956c409f0040b32e85c1d00e209888235435d063076/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f61746c646179732f6c61726176656c2d7363756c70746f722f63692e796d6c3f7374796c653d666f722d7468652d6261646765266c6162656c3d4349)](https://github.com/atldays/laravel-sculptor/actions/workflows/ci.yml)[![License: MIT](https://camo.githubusercontent.com/7a1226d14a365d288bfe51ece915ee0c7e754a16faa51ff06436504de29b33b4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e7376673f7374796c653d666f722d7468652d6261646765)](LICENSE.md)

`laravel-sculptor` provides reusable query objects for Eloquent.

It moves complex read logic out of controllers and services into dedicated classes with a consistent API for:

- model binding
- `select` control
- eager loading
- filters
- result execution
- pagination
- result caching
- builder-level cache integration

Why
---

[](#why)

As Laravel applications grow, read queries often become hard to maintain:

- controllers start building large queries inline
- services repeat the same `with`, `select`, and filtering logic
- cache behavior becomes inconsistent
- query rules become difficult to test in isolation

Sculptor solves this by introducing query objects: focused classes that represent a single read operation.

Installation
------------

[](#installation)

Add the package via Composer:

```
composer require atldays/laravel-sculptor
```

Publish the package config if needed:

```
php artisan vendor:publish --tag=sculptor-config
```

Requirements
------------

[](#requirements)

- PHP `^8.2`
- Laravel `^10.0|^11.0|^12.0|^13.0`

Core Classes
------------

[](#core-classes)

ClassFiltersCacheRequires query-cache-enabled model`BaseQuery`NoNoNo`Query`YesNoNo`CachedQuery`YesResult cacheNo`BuilderCachedQuery`YesBuilder cacheYesThese classes are the recommended entry points for day-to-day use. Lower-level traits are available when you need custom composition.

Quick Start
-----------

[](#quick-start)

```
