PHPackages                             ahmed-arafat/laravel-allinone-toolkit - 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. ahmed-arafat/laravel-allinone-toolkit

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

ahmed-arafat/laravel-allinone-toolkit
=====================================

Laravel utilities: sorting, filtering, searching, file uploads, Excel, enums, JWT, validation rules, migrations, and seeders

v1.0.14(2mo ago)012↓50%MITPHPPHP &gt;=8.1

Since Nov 1Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Ahmed-Arafat10/Laravel-All-In-One-Toolkit-Package)[ Packagist](https://packagist.org/packages/ahmed-arafat/laravel-allinone-toolkit)[ RSS](/packages/ahmed-arafat-laravel-allinone-toolkit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (14)Used By (0)

Laravel All-In-One Toolkit
==========================

[](#laravel-all-in-one-toolkit)

A **curated Laravel toolkit** that centralizes common API patterns, validation rules, Eloquent querying utilities, console commands, and developer productivity helpers — designed to reduce boilerplate and enforce consistency across projects.

Built for real-world Laravel applications, not demos.

---

Badges
------

[](#badges)

[![PHP](https://camo.githubusercontent.com/6518db1335bf20fdff07253dc6d6d0cec955b5fb6a8ef1382ac6d73687ecc07f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d626c7565)](https://camo.githubusercontent.com/6518db1335bf20fdff07253dc6d6d0cec955b5fb6a8ef1382ac6d73687ecc07f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d626c7565)[![Laravel](https://camo.githubusercontent.com/9bae2d9be2f5ba784143b82eae0b083e86e830cdaa9e751e8205adb30d882814/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d3130253230253743253230313125323025374325323031322d726564)](https://camo.githubusercontent.com/9bae2d9be2f5ba784143b82eae0b083e86e830cdaa9e751e8205adb30d882814/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d3130253230253743253230313125323025374325323031322d726564)[![License](https://camo.githubusercontent.com/18a973310f780d5311ee51ed72644ae724d851709d12dd9b332992854a8988d5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f61686d65642d6172616661742f6c61726176656c2d616c6c696e6f6e652d746f6f6c6b6974)](https://camo.githubusercontent.com/18a973310f780d5311ee51ed72644ae724d851709d12dd9b332992854a8988d5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f61686d65642d6172616661742f6c61726176656c2d616c6c696e6f6e652d746f6f6c6b6974)
[![Packagist Version](https://camo.githubusercontent.com/2d40ddd9a61c8cdd8977196478c89a7c0b431dd63e958306dc31751db551485e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61686d65642d6172616661742f6c61726176656c2d616c6c696e6f6e652d746f6f6c6b6974)](https://camo.githubusercontent.com/2d40ddd9a61c8cdd8977196478c89a7c0b431dd63e958306dc31751db551485e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61686d65642d6172616661742f6c61726176656c2d616c6c696e6f6e652d746f6f6c6b6974)
[![Packagist Downloads](https://camo.githubusercontent.com/e87227f85332ac405863510df43aee1500a9bee142dcfa68d9d9ab78bf12f845/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61686d65642d6172616661742f6c61726176656c2d616c6c696e6f6e652d746f6f6c6b6974)](https://camo.githubusercontent.com/e87227f85332ac405863510df43aee1500a9bee142dcfa68d9d9ab78bf12f845/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61686d65642d6172616661742f6c61726176656c2d616c6c696e6f6e652d746f6f6c6b6974)
[![Maintained](https://camo.githubusercontent.com/da21b16c25c3d396a17fe7ba748e0497a765b934030128e412161493c4ea5bec/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d61696e7461696e65642d7965732d73756363657373)](https://camo.githubusercontent.com/da21b16c25c3d396a17fe7ba748e0497a765b934030128e412161493c4ea5bec/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d61696e7461696e65642d7965732d73756363657373)
[![Stable](https://camo.githubusercontent.com/227f0905cc20b37a1baac118a3da4f631e0147dabc2be1d9710672498fdfd554/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73746162696c6974792d737461626c652d73756363657373)](https://camo.githubusercontent.com/227f0905cc20b37a1baac118a3da4f631e0147dabc2be1d9710672498fdfd554/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73746162696c6974792d737461626c652d73756363657373)

---

Introduction
------------

[](#introduction)

Laravel All-In-One Toolkit provides a structured set of reusable **traits**, **helpers**, **middleware**, **exceptions**, and **Artisan commands** that solve recurring problems in Laravel projects.

Instead of reimplementing the same logic across applications, this toolkit offers opinionated, Laravel-native abstractions for:

- API response consistency
- Validation rule composition
- Query filtering, searching, and sorting
- Pagination enhancements
- Date handling and formatting
- File and Excel data processing
- Database seeding and automation

---

Design Philosophy
-----------------

[](#design-philosophy)

- Prefer explicit and readable helpers over hidden magic
- Reduce repetitive boilerplate across projects
- Follow Laravel conventions instead of reinventing them
- Keep utilities framework-aware, not framework-agnostic
- Provide small, composable building blocks

---

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

[](#installation)

Install the package via Composer:

```
composer require ahmed-arafat/laravel-allinone-toolkit
```

The package is auto-discovered by Laravel. No manual registration is required.

---

API Reference (Purpose &amp; Method Signatures)
===============================================

[](#api-reference-purpose--method-signatures)

> This document describes the **intended public API** of the package. Each class/trait and method includes a short description of **its responsibility and use case**.

---

Console Commands
----------------

[](#console-commands)

### `DatabaseInitialSeedersCommand`

[](#databaseinitialseederscommand)

**Purpose:**Runs all initial database seeders in a controlled and automated way.

```
class DatabaseInitialSeedersCommand
{
    /**
     * Initialize command dependencies.
     */
    public function __construct();

    /**
     * Execute all initial database seeders.
     */
    public function handle(): void;
}
```

---

### `GitCommand`

[](#gitcommand)

**Purpose:**Provides Git-related automation tasks through Artisan.

```
class GitCommand
{
    /**
     * Execute the Git command logic.
     */
    public function handle();
}
```

---

### `PhpMyAdminDatabaseTablesExtractorCommand`

[](#phpmyadmindatabasetablesextractorcommand)

**Purpose:**Extracts database table definitions from phpMyAdmin SQL exports and processes them programmatically.

```
class PhpMyAdminDatabaseTablesExtractorCommand
{
    /**
     * Initialize the extractor command.
     */
    public function __construct();

    /**
     * Handle SQL file extraction and processing.
     */
    public function handle(): void;
}
```

---

Exceptions
----------

[](#exceptions)

### `ValidationErrorsAsArrayException`

[](#validationerrorsasarrayexception)

**Purpose:**Transforms validation errors into a structured array format suitable for API responses.

```
class ValidationErrorsAsArrayException
{
    /**
     * Create a new validation exception instance.
     */
    public function __construct(
        string $message = "",
        int $code = 0,
        ?Throwable $previous = null
    );
}
```

---

Traits (Core Helpers)
---------------------

[](#traits-core-helpers)

### `ApiResponser`

[](#apiresponser)

**Purpose:**Provides a unified structure for API responses (success, error, pagination, messages).

```
trait ApiResponser
{
    /**
     * Build a standardized successful API response.
     */
    protected function apiSuccess(
        mixed $data = null,
        ?string $message = null,
        array $meta = []
    ): array;

    /**
     * Build a standardized error API response.
     */
    protected function apiError(
        string $message,
        array $errors = [],
        array $meta = []
    ): array;

    /**
     * Build a paginated API response.
     */
    protected function apiPaginated(
        LengthAwarePaginator $paginator,
        ?string $message = null
    ): array;

    /**
     * Build a simple message-only API response.
     */
    protected function apiMessage(string $message): array;
}
```

---

### `JsonApiResponser`

[](#jsonapiresponser)

**Purpose:**Generates JSON responses compliant with HTTP status codes and API best practices.

```
trait JsonApiResponser
{
    /**
     * Return a successful JSON response.
     */
    protected function jsonSuccess(
        mixed $data = null,
        ?string $message = null,
        int $status = 200,
        array $meta = []
    ): JsonResponse;

    /**
     * Return an error JSON response.
     */
    protected function jsonError(
        string $message,
        int $status = 400,
        array $errors = [],
        array $meta = []
    ): JsonResponse;

    /**
     * Return a paginated JSON response.
     */
    protected function jsonPaginated(
        LengthAwarePaginator $paginator,
        ?string $message = null,
        int $status = 200
    ): JsonResponse;

    /**
     * Return a message-only JSON response.
     */
    protected function jsonMessage(
        string $message,
        int $status = 200
    ): JsonResponse;
}
```

---

### `CustomRule`

[](#customrule)

**Purpose:**Simplifies the creation of reusable and expressive Laravel validation rules.

```
trait CustomRule
{
    /**
     * Create a strong password validation rule.
     */
    public function strongPassword(
        int $min = 8,
        bool $hasMixed = true,
        bool $hasNumbers = true,
        bool $hasSymbols = true,
        bool $uncompromised = true
    ): Password;

    /**
     * Create an exists rule with optional conditions.
     */
    public function existsRule(
        string $table,
        string $column = 'id',
        ?Closure $whereClosure = null
    ): Exists;

    /**
     * Create a unique rule with optional ignore and conditions.
     */
    public function uniqueRule(
        string $table,
        string $column,
        ?Closure $whereClosure = null,
        mixed $ignoreId = null
    ): Unique;

    /**
     * Create an exists rule limited to active records.
     */
    public function existsActiveRule(
        string $table,
        string $column = 'id',
        string $activeColumn = 'is_active'
    ): Exists;

    /**
     * Create a unique rule scoped to a specific column/value.
     */
    public function uniqueScopedRule(
        string $table,
        string $column,
        string $scopeColumn,
        mixed $scopeValue,
        mixed $ignoreId = null
    ): Unique;
}
```

---

### `DateHelper`

[](#datehelper)

**Purpose:**Provides common date parsing, formatting, and comparison utilities using Carbon.

```
trait DateHelper
{
    /**
     * Parse a date into a Carbon instance.
     */
    protected function parseDate(
        DateTimeInterface|string $date,
        string $timeZone = null
    ): Carbon;

    /**
     * Calculate the difference in years, months, and days.
     */
    public function diffInYearsMonthsDays(
        DateTimeInterface|string $startDate,
        DateTimeInterface|string $endDate
    ): array;

    /**
     * Check if a date is between two dates.
     */
    public function isBetweenDates(
        DateTimeInterface|string $date,
        DateTimeInterface|string $startDate,
        DateTimeInterface|string $endDate
    ): bool;

    /**
     * Determine if a date is in the past.
     */
    public function isPastDate(DateTimeInterface|string $date): bool;

    /**
     * Determine if a date is in the future.
     */
    public function isFutureDate(DateTimeInterface|string $date): bool;

    /**
     * Convert a date to ISO format.
     */
    public function toIsoDate(DateTimeInterface|string $date): string;

    /**
     * Format a date using a custom format.
     */
    public function formatDate(
        DateTimeInterface|string $date,
        string $format = 'Y-m-d',
        string $timeZone = null
    ): ?string;

    /**
     * Calculate age from a birth date.
     */
    public function calculateAge(
        DateTimeInterface|string $birthDate
    ): int;

    /**
     * Add business days to a date.
     */
    public function addBusinessDays(
        DateTimeInterface|string $date,
        int $days
    ): Carbon;
}
```

---

### `ExcelFormatter`

[](#excelformatter)

**Purpose:**Extracts and normalizes Excel data into PHP arrays.

```
trait ExcelFormatter
{
    /**
     * Extract data from an uploaded Excel file.
     */
    public function excelFileExtractor(
        string $fileKey,
        bool $likeExcelCells = true,
        int $sheetIndex = 0,
        bool $skipEmptyCells = true
    ): array;
}
```

---

### `FileHelper`

[](#filehelper)

**Purpose:**Provides helper methods for working with files and file content.

```
trait FileHelper
{
    /**
     * Read and decode JSON file contents.
     */
    private function getJsonFileContent(
        string $path,
        string $disk = 'local'
    ): array;
}
```

---

### `PaginatorHelper`

[](#paginatorhelper)

**Purpose:**Enhances paginated results with additional metadata.

```
trait PaginatorHelper
{
    /**
     * Add sequential row numbers to paginated results.
     */
    public function addRowNumbers(
        LengthAwarePaginator $paginator,
        ?Request $request = null,
        string $perPageKey = 'per_page',
        string $pageKey = 'page',
        string $attribute = 'num',
        int $defaultPerPage = 10
    ): void;
}
```

---

### `QueryParameter`

[](#queryparameter)

**Purpose:**Resolves query string parameters into model data.

```
trait QueryParameter
{
    /**
     * Resolve a single model from a query parameter.
     */
    public function resolveQueryModel(
        Request $request,
        string $keyName,
        string $model,
        string $column = 'id'
    ): ?array;

    /**
     * Resolve multiple models from a query parameter.
     */
    public function resolveQueryModels(
        Request $request,
        string $keyName,
        string $model,
        string $column = 'id'
    ): ?array;
}
```

---

### Eloquent Traits (`Filterable`, `Searchable`, `Sortable`)

[](#eloquent-traits-filterable-searchable-sortable)

**Purpose:**Provide reusable query scopes for filtering, searching, and sorting Eloquent models.

```
trait FilterableTrait
{
    /**
     * Apply dynamic filtering to a query.
     */
    public function scopeFilter(
        Builder $q,
        string $filterColKey = 'filter_col',
        string $filterValKey = 'filter_val'
    ): Builder;
}
```

```
trait SearchableTrait
{
    /**
     * Apply keyword search to a query.
     */
    public function scopeSearch(Builder $q): Builder;
}
```

```
trait SortableTrait
{
    /**
     * Apply dynamic sorting to a query.
     */
    public function scopeSortByColumn(
        Builder $q,
        $target = null,
        $dir = null
    ): Builder;
}
```

Project Structure
-----------------

[](#project-structure)

```
src/
 ├── Api/
 ├── Console/
 ├── Eloquent/
 ├── Exceptions/
 ├── Helpers/
 ├── Middleware/
 ├── Traits/
 └── Support/

```

---

Who Is This For?
----------------

[](#who-is-this-for)

- Laravel developers building APIs or admin panels
- Teams that want consistent validation and response structures
- Projects that frequently implement filtering, searching, and sorting
- Developers who value clean abstractions over copy-pasted snippets

---

Versioning
----------

[](#versioning)

This package follows **semantic versioning**.

- `1.x` — Stable public API
- Minor versions may add new features
- Breaking changes will only occur in major versions

---

Contributing
------------

[](#contributing)

Contributions are welcome.

- Follow PSR-12 coding standards
- Write clear commit messages
- Add tests for new functionality when applicable

---

License
-------

[](#license)

Laravel All-In-One Toolkit is open-sourced software licensed under the MIT license.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance86

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~41 days

Recently: every ~1 days

Total

13

Last Release

67d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/925994005991bee77fd7d653792d7e27a2b702a861fa1e0ce8101260a253f0d1?d=identicon)[Ahmed-Arafat10](/maintainers/Ahmed-Arafat10)

---

Top Contributors

[![Ahmed-Arafat10](https://avatars.githubusercontent.com/u/63191956?v=4)](https://github.com/Ahmed-Arafat10 "Ahmed-Arafat10 (60 commits)")

---

Tags

apiapi-responseartisancli-commandseloquentfile-uploadfilteringgithelperslaravellaravel-packagemigrationpaginationphpquery-buildersearchsortingvalidationjwtsearchenumexcelfiltermigrationssortgitfile-uploadvalidation-rulesdatabase-seeder

### Embed Badge

![Health badge](/badges/ahmed-arafat-laravel-allinone-toolkit/health.svg)

```
[![Health](https://phpackages.com/badges/ahmed-arafat-laravel-allinone-toolkit/health.svg)](https://phpackages.com/packages/ahmed-arafat-laravel-allinone-toolkit)
```

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[mehdi-fathi/eloquent-filter

Eloquent Filter adds custom filters automatically to your Eloquent Models in Laravel.It's easy to use and fully dynamic, just with sending the Query Strings to it.

450191.6k1](/packages/mehdi-fathi-eloquent-filter)[jedrzej/pimpable

Laravel 4/5/6 package that allows to dynamically filter, sort and eager load relations for your models using request parameters

105179.0k1](/packages/jedrzej-pimpable)[mohammad-fouladgar/eloquent-builder

527189.5k](/packages/mohammad-fouladgar-eloquent-builder)[jedrzej/searchable

Searchable trait for Laravel's Eloquent models - filter your models using request parameters

127259.1k5](/packages/jedrzej-searchable)[aldemeery/sieve

A simple, clean and elegant way to filter Eloquent models.

1396.3k](/packages/aldemeery-sieve)

PHPackages © 2026

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