e2tmk/hunter

Powerful utility for finding and processing Eloquent model records with a fluent, chainable API.

Fund package maintenance!
e2tmk

v1.1.2 2025-06-26 19:48 UTC

README

Hunter Logo

Hunter

Latest Version on Packagist Total Downloads

Powerful utility for finding and processing Eloquent model records with a fluent, chainable API.

Hunter provides a clean way to search for records based on specific criteria and execute multiple actions on them with comprehensive error handling, logging, and advanced flow control.

Installation

You can install the package via Composer:

composer require e2tmk/hunter

Quick Example

use Hunter\Hunter;

// Process all pending orders
$result = hunter(Order::class)
    ->find('status', 'pending')
    ->then(function (Order $order) {
        $order->process();
    })
    ->hunt();

echo $result->summary(); // "Total: 15, Successful: 14, Failed: 1, Skipped: 0"

Features

  • πŸ” Powerful Search: Find records with flexible criteria
  • πŸ”— Fluent API: Chainable methods for clean code
  • 🎯 Multiple Actions: Execute several actions per record
  • ⚑ Flow Control: Skip, fail, or stop processing gracefully
  • πŸ“Š Comprehensive Reporting: Detailed statistics and error tracking

Documentation

πŸ“– Complete Documentation

License

The project is licensed under the MIT License.