Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Inputbag Laravel Package

jaikumar0101/laravel-inputbag

Fluent builder to standardize Laravel request inputs for search, pagination, and sorting. Provides sensible defaults, configurable global settings, and custom field mappings so controllers stay clean and API responses remain consistent (array or collection output).

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Standardizing API/Controller Input Handling: Reduces inconsistency in how search, pagination, and sorting parameters are processed across microservices or modules, improving maintainability.
  • Developer Velocity: Accelerates feature development by abstracting repetitive input validation/transformation logic, allowing engineers to focus on business logic.
  • API Consistency: Enforces uniform response structures for filtering/sorting/pagination, simplifying frontend integration and reducing edge-case bugs.
  • Build vs. Buy Decision: Justifies avoiding custom in-house solutions for input parsing, reducing technical debt and leveraging community-driven improvements.
  • Roadmap for Scalability: Supports future-proofing by centralizing input handling logic, making it easier to add new features (e.g., multi-tenancy filters) without controller sprawl.

When to Consider This Package

  • Avoid if:
    • Your team prefers explicit over fluent syntax (e.g., manual Request validation with Laravel’s built-in features).
    • You need highly custom validation rules per endpoint (this package prioritizes standardization over granularity).
    • Your project uses Laravel <11.x or PHP <8.2 (compatibility constraints).
    • You’re building a low-complexity app where input handling is trivial (e.g., CRUD-only with no search/sort).
  • Consider alternatives if:
    • You require advanced validation (e.g., nested objects, complex conditional rules) → Use Laravel’s native ValidatesRequests or API Resources.
    • You need real-time input parsing (e.g., WebSockets) → This is HTTP-request focused.
    • Your team lacks PHP/Laravel fluency → The fluent API may introduce a learning curve.

How to Pitch It (Stakeholders)

For Executives: "This package standardizes how our APIs handle search, pagination, and sorting—cutting dev time by 30% on repetitive input logic while ensuring consistent responses. It’s like a ‘copy-paste’ for best practices, reducing bugs and speeding up feature delivery. MIT-licensed, zero lock-in, and works out-of-the-box with Laravel 11/12."

For Engineering: *"Imagine never writing Request->get('search'), Request->get('per_page'), or Request->get('sort') again. This gives us a fluent, type-safe way to handle inputs with defaults, custom mappings, and auto-loaded configs. Perfect for:

  • APIs: Standardize pagination/sorting across endpoints.
  • Admin panels: Centralize search/filter logic.
  • Microservices: Enforce consistent input handling. It’s lightweight, MIT-licensed, and plays well with Laravel’s ecosystem. Let’s prototype it in [Module X] to validate the ROI."*

For Developers: *"This replaces boilerplate like:

$search = $request->get('q', '');
$perPage = $request->get('per_page', 15);
$sort = $request->get('sort', 'created_at');

With:

$inputs = InputBag::make($request)
    ->search('q')
    ->paginate('per_page', 15)
    ->sort('sort', 'created_at')
    ->toArray();
  • Pros: Cleaner code, defaults, and type safety.
  • Cons: Slight learning curve if you’re new to fluent APIs. Want to test it in [Feature Y]?"*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours