PHPackages                             litepie/repository - 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. litepie/repository

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

litepie/repository
==================

Litepie Repository - Laravel Repository Pattern with Enterprise Features

v1.0.6(5mo ago)0241MITPHPPHP ^8.2

Since Aug 24Pushed 5mo agoCompare

[ Source](https://github.com/Litepie/Repository)[ Packagist](https://packagist.org/packages/litepie/repository)[ RSS](/packages/litepie-repository/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (8)Used By (1)

Litepie Repository - Laravel Repository Pattern with Enterprise Features
========================================================================

[](#litepie-repository---laravel-repository-pattern-with-enterprise-features)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d28f07f0519106b372a75ed2a567c0afd8ad51d31ab1c7ec14585e48ed0b3f51/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6974657069652f7265706f7369746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/litepie/repository)[![Total Downloads](https://camo.githubusercontent.com/06bf6a3fc5d42c5805ac4c2c39d2eaa9b0020e57fad4df6714bf99a12e9b9390/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6974657069652f7265706f7369746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/litepie/repository)[![License](https://camo.githubusercontent.com/70e5c29ef0590399e8e96edb01798604158569f57131a20b6b8dbb57f60c3bb6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c6974657069652f7265706f7369746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/litepie/repository)

A comprehensive Laravel repository package that provides enterprise-level features for data access, performance optimization, analytics, and advanced querying capabilities. Perfect for applications handling large datasets, complex relationships, and requiring high-performance data operations.

✨ Features
----------

[](#-features)

### Core Repository Pattern

[](#core-repository-pattern)

- ✅ **Complete CRUD Operations** - Standard create, read, update, delete operations
- ✅ **Clean Interface Separation** - Well-defined contracts and implementations
- ✅ **Laravel Best Practices** - Follows Laravel conventions and patterns

### Advanced Query Building

[](#advanced-query-building)

- � **Advanced Join Capabilities** - Left, right, inner joins with relationship handling
- 🔍 **Comprehensive Filtering** - Dynamic field filtering with multiple operators
- 🎯 **Query String Parser** - Parse complex URL filters with 20+ operators
- 📊 **Dynamic Scopes &amp; Macros** - Extensible query building with custom scopes

### Performance &amp; Optimization

[](#performance--optimization)

- 🚀 **Large Dataset Optimization** - Handle 5M+ records efficiently with cursor pagination
- ⚡ **Smart Pagination** - Auto-optimization for different dataset sizes
- � **Performance Metrics** - Built-in profiling and query analysis
- 🧠 **Intelligent Caching** - Advanced caching with tags and auto-invalidation

### Data Operations

[](#data-operations)

- � **Bulk Operations** - Efficient bulk insert, update, delete, and upsert
- 🔄 **Batch Processing** - Process large datasets in manageable chunks
- 📁 **Data Export/Import** - CSV, JSON, Excel export/import with streaming
- � **Relationship Manager** - Advanced relationship handling and optimization

### Analytics &amp; Insights

[](#analytics--insights)

- 📊 **Repository Aggregations** - Statistical analysis and trend calculations
- 📈 **Analytics Functions** - Percentiles, correlations, moving averages
- � **Pivot Tables** - Dynamic data pivoting and cross-tabulation
- 📉 **Histogram Generation** - Data distribution analysis

### Search &amp; Discovery

[](#search--discovery)

- 🔍 **Multi-Engine Search** - Database, Elasticsearch, and Algolia integration
- 🎯 **Fuzzy Search** - Similarity-based matching with configurable thresholds
- 📝 **Full-Text Search** - Advanced text search with relevance scoring
- 🔧 **Search Index Management** - Automated indexing and reindexing

### Events &amp; Monitoring

[](#events--monitoring)

- 🎪 **Repository Events** - Comprehensive event system for all operations
- � **Performance Monitoring** - Real-time metrics and benchmarking
- 🚨 **Error Tracking** - Built-in error handling and reporting
- 📋 **Audit Trail** - Complete operation logging and tracking

### Security &amp; Validation

[](#security--validation)

- 🛡️ **Field Whitelisting** - Secure field access control
- ✅ **Input Validation** - Built-in data validation and sanitization
- � **Rate Limiting Ready** - Prepared for rate limiting implementation
- 🛡️ **SQL Injection Protection** - Secure query building [![Latest Version on Packagist](https://camo.githubusercontent.com/d28f07f0519106b372a75ed2a567c0afd8ad51d31ab1c7ec14585e48ed0b3f51/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6974657069652f7265706f7369746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/litepie/repository)[![Total Downloads](https://camo.githubusercontent.com/06bf6a3fc5d42c5805ac4c2c39d2eaa9b0020e57fad4df6714bf99a12e9b9390/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6974657069652f7265706f7369746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/litepie/repository)[![License](https://camo.githubusercontent.com/70e5c29ef0590399e8e96edb01798604158569f57131a20b6b8dbb57f60c3bb6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c6974657069652f7265706f7369746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/litepie/repository)

A Laravel package that implements the Repository pattern with a clean, intuitive API. This package provides a base repository class, interfaces, service provider bindings, CRUD operations, pagination support, and artisan commands to generate repositories.

Features
--------

[](#features)

- 🏗️ **Repository Pattern Implementation** - Clean separation of data access logic
- 🔧 **Base Repository Class** - Common CRUD operations out of the box
- 🎯 **Repository Interface** - Contract-based development
- 📦 **Service Provider** - Automatic Laravel integration
- 🔍 **Advanced Querying** - Search, filtering, and sorting capabilities
- � **Comprehensive Join Support** - Inner, left, right, cross joins with subqueries
- 📊 **Aggregation Methods** - Group by, having, raw expressions, and complex analytics
- �📄 **Pagination Support** - Built-in pagination methods
- ⚡ **Artisan Commands** - Generate repositories with `make:repository`
- 🧪 **Fully Tested** - Comprehensive test suite
- 📚 **Well Documented** - Complete documentation and examples

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

[](#requirements)

- PHP 8.2 or higher
- Laravel 11.0 or 12.0

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

[](#installation)

You can install the package via Composer:

```
composer require litepie/repository
```

The package will automatically register its service provider.

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

[](#quick-start)

### 1. Create a Repository

[](#1-create-a-repository)

Use the artisan command to generate a repository:

```
php artisan make:repository UserRepository
```

This will create a repository class and interface in your `app/Repositories` directory.

### 2. Use the Repository

[](#2-use-the-repository)

```
