PHPackages                             omarchouman/lara-util-x - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. omarchouman/lara-util-x

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

omarchouman/lara-util-x
=======================

LaraUtilX is a comprehensive Laravel package that empowers developers with a rich set of utilities, helpful traits, middleware, and more. Streamline common tasks, enhance code readability, and boost the functionality of your Laravel applications with this versatile toolkit.

1.5.1(3mo ago)1694775MITPHP

Since Jan 27Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/omarchouman/lara-util-x)[ Packagist](https://packagist.org/packages/omarchouman/lara-util-x)[ RSS](/packages/omarchouman-lara-util-x/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (3)Versions (20)Used By (0)

LaraUtilX: Unleash the Power of Laravel with Utilities and Helpers
==================================================================

[](#larautilx-unleash-the-power-of-laravel-with-utilities-and-helpers)

 [![LaraUtilX Logo](assets/LaraUtilX.svg)](assets/LaraUtilX.svg)

LaraUtilX is a comprehensive Laravel package designed to supercharge your development experience by providing a suite of utility classes, helpful traits, middleware, and more. Whether you're a seasoned Laravel developer or just getting started, LaraUtilX offers a collection of tools to streamline common tasks and enhance the functionality of your Laravel applications.

**Version:** 1.3.0
**Laravel Support:** Laravel 8.0+
**PHP Support:** PHP 8.0+
**License:** MIT

---

📘 **Full Documentation**
Explore full usage examples, configuration options, and best practices at:
👉

---

Key Features
------------

[](#key-features)

1. **CrudController:** Simplify your CRUD operations with the generic `CrudController` that can be easily extended, allowing you to create, read, update, and delete records effortlessly.
2. **ApiResponseTrait:** Craft consistent and standardized API responses with the `ApiResponseTrait`. This trait provides helper methods for formatting JSON responses, making your API endpoints clean and well-structured.
3. **FileProcessingTrait:** Manage file uploads and deletions seamlessly with the `FileProcessingTrait`. This trait offers methods for uploading single or multiple files, deleting files, and now retrieving file contents.
4. **ValidationHelperTrait:** Validate user input with ease using the `ValidationHelperTrait`. This trait includes handy methods for common validation scenarios, such as email addresses, phone numbers, and strong passwords.
5. **SchedulerMonitor:** Keep an eye on your scheduled tasks with the `SchedulerUtil` utility. Monitor upcoming scheduled events, check if tasks are overdue, and gain insights into the status of your scheduled jobs.
6. **FilteringUtil:** Effortlessly filter data based on specified criteria with the `FilteringUtil`. This utility provides a convenient way to filter collections or arrays based on field names, operators, and values.
7. **AccessLogMiddleware:** LaraUtilX includes middleware components like the `AccessLogMiddleware` to log access to your application, adding an extra layer of security and accountability.
8. **PaginationUtil:** Seamlessly handle paginated data with LaraUtilX's `PaginationUtil`. This utility simplifies the process of paginating query results, allowing you to customize the number of items per page, navigate through paginated results effortlessly, and present data in a user-friendly manner.
9. **CachingUtil:** Optimize performance and reduce database queries using LaraUtilX's `CachingUtil`. Store and retrieve frequently accessed data with ease, taking advantage of features like customizable cache expiration and cache tags.
10. **ConfigUtil:** Manage your Laravel configuration settings effortlessly with the `ConfigUtil`. Retrieve, set defaults, and dynamically manipulate configuration data. Simplify the way you interact with your application's configuration, ensuring a clean and organized approach.
11. **LLM Providers:** Effortlessly integrate advanced AI-powered chat completions into your Laravel application with our LLM providers. Choose between OpenAI's GPT models or Google's Gemini models through a unified interface. Both providers support all major chat parameters, automatic retry logic, and structured responses. Generate dynamic, context-aware text completions for your users with just a few lines of code.

    - **OpenAIProvider:** Interact with OpenAI's GPT models (GPT-3.5, GPT-4, etc.)
    - **GeminiProvider:** Interact with Google's Gemini models (Gemini 2.0 Flash, etc.)
    - **Configurable Provider Selection:** Switch between providers via configuration
    - **Unified Interface:** Same API for both providers with automatic model selection
12. **FeatureToggleUtil:** Implement feature flags and toggles with ease using the `FeatureToggleUtil`. Enable or disable features dynamically based on configuration, user context, or environment settings. Perfect for A/B testing, gradual rollouts, and feature management.
13. **LoggingUtil:** Enhance your application's logging capabilities with the `LoggingUtil`. Create structured logs with JSON formatting, custom channels, and contextual information. Includes predefined methods for all log levels with automatic timestamp and environment tracking.
14. **QueryParameterUtil:** Parse and validate query parameters from HTTP requests with the `QueryParameterUtil`. Safely extract and filter query parameters based on allowed lists, improving API security and data handling.
15. **RateLimiterUtil:** Implement rate limiting for your APIs and endpoints using the `RateLimiterUtil`. Control request frequency, prevent abuse, and manage API usage with configurable limits and decay times.
16. **Auditable Trait:** Automatically track model changes with the `Auditable` trait. Log create, update, and delete operations with user context, old values, and new values. Perfect for audit trails and compliance requirements.
17. **RejectCommonPasswords Rule:** Strengthen password security with the `RejectCommonPasswords` validation rule. Prevent users from using common, easily guessable passwords with a comprehensive list of weak passwords.

Test Suite
----------

[](#test-suite)

LaraUtilX comes with a comprehensive test suite that ensures reliability and quality. The test suite includes both unit tests and feature tests covering all utilities, traits, and components.

### Running Tests

[](#running-tests)

#### Prerequisites

[](#prerequisites)

Make sure you have installed the development dependencies:

```
composer install --dev
```

#### Run All Tests

[](#run-all-tests)

```
./vendor/bin/phpunit
```

#### Run Specific Test Suites

[](#run-specific-test-suites)

```
# Run only unit tests
./vendor/bin/phpunit --testsuite Unit

# Run only feature tests
./vendor/bin/phpunit --testsuite Feature
```

#### Run Specific Test Classes

[](#run-specific-test-classes)

```
# Run tests for a specific utility
./vendor/bin/phpunit tests/Unit/Utilities/CachingUtilTest.php

# Run tests for a specific trait
./vendor/bin/phpunit tests/Unit/Traits/ApiResponseTraitTest.php
```

#### Run Tests with Coverage

[](#run-tests-with-coverage)

```
./vendor/bin/phpunit --coverage-html coverage
```

### Test Coverage

[](#test-coverage)

The test suite provides comprehensive coverage for:

- **Utilities**: All utility classes with their methods and edge cases
- **Traits**: All traits with their functionality and integration
- **Enums**: All enum values and behaviors
- **Rules**: Validation rules with various input scenarios
- **Feature Tests**: Integration scenarios and performance tests

### Test Structure

[](#test-structure)

```
tests/
├── TestCase.php                    # Base test case with Laravel setup
├── Unit/                          # Unit tests for individual components
│   ├── Enums/
│   │   └── LogLevelTest.php
│   ├── Rules/
│   │   └── RejectCommonPasswordsTest.php
│   ├── Traits/
│   │   ├── ApiResponseTraitTest.php
│   │   └── FileProcessingTraitTest.php
│   └── Utilities/
│       ├── CachingUtilTest.php
│       ├── ConfigUtilTest.php
│       ├── FeatureToggleUtilTest.php
│       ├── FilteringUtilTest.php
│       ├── LoggingUtilTest.php
│       ├── PaginationUtilTest.php
│       ├── QueryParameterUtilTest.php
│       ├── RateLimiterUtilTest.php
│       └── SchedulerUtilTest.php
└── Feature/                       # Integration tests
    ├── Traits/
    │   └── ApiResponseTraitFeatureTest.php
    └── Utilities/
        └── CachingUtilFeatureTest.php

```

How to Get Started
------------------

[](#how-to-get-started)

1. Install LaraUtilX using Composer: ```
    composer require omarchouman/lara-util-x
    ```
2. Explore the included utilities, traits, and middleware in your Laravel project.
3. Customize and extend LaraUtilX to match the specific needs of your application.

Development &amp; Contributing
------------------------------

[](#development--contributing)

LaraUtilX is actively maintained and welcomes contributions! The package includes a comprehensive test suite to ensure reliability and quality.

### Development Setup

[](#development-setup)

1. Clone the repository
2. Install dependencies: `composer install --dev`
3. Run tests: `./vendor/bin/phpunit`
4. Check code coverage: `./vendor/bin/phpunit --coverage-html coverage`

### Writing Tests

[](#writing-tests)

When contributing new features:

- Write unit tests for individual components
- Write feature tests for integration scenarios
- Maintain high test coverage (90%+)
- Follow the AAA pattern: Arrange, Act, Assert
- Test edge cases and error conditions

### Code Quality

[](#code-quality)

- Follow PSR-12 coding standards
- Use descriptive variable and method names
- Include comprehensive docblocks
- Handle errors gracefully
- Write clean, maintainable code

Save time, enhance code readability, and boost your Laravel projects with LaraUtilX – the toolkit every Laravel developer deserves.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance81

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~43 days

Total

19

Last Release

101d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a02c357b1ec4729d48ab2dd35aa3b2075e3b956879e056d8b8a67e3b08c570a?d=identicon)[omarchouman](/maintainers/omarchouman)

---

Top Contributors

[![omarchouman](https://avatars.githubusercontent.com/u/72022461?v=4)](https://github.com/omarchouman "omarchouman (15 commits)")[![aliberro39109](https://avatars.githubusercontent.com/u/54240750?v=4)](https://github.com/aliberro39109 "aliberro39109 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/omarchouman-lara-util-x/health.svg)

```
[![Health](https://phpackages.com/badges/omarchouman-lara-util-x/health.svg)](https://phpackages.com/packages/omarchouman-lara-util-x)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
