Weave 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

Airwire Laravel Package

archtechx/airwire

Airwire bridges Laravel Livewire and Alpine.js, letting you call Livewire component methods directly from Alpine expressions through a small JavaScript API. It gives Alpine reactive access to server-side state without extra boilerplate, keeping interactive Laravel frontends simple.

View on GitHub
Deep Wiki
Context7

Getting Started

This package is still early in its lifecycle (v0.1.x), so treat the README and the test suite as the source of truth. The v0.1.4 release specifically adds handling for the case where a model has no records, which is a common day-to-day concern in Laravel applications.

Minimal steps:

  1. Install the package with Composer using the package name from the repository README.
  2. Publish any config or views if the install instructions call for it.
  3. Run the package test suite or a small feature test against a model with zero records before relying on the new empty-state behavior.
  4. Look first at:
    • the README section covering empty model results,
    • the v0.1.4 changelog entry,
    • the package tests that assert behavior when a query returns no records,
    • any service provider bindings or traits that hook into Eloquent model queries.

First use case: a controller or API endpoint that lists records for a model and currently returns a blank response, an empty paginator with confusing metadata, or an error when no rows exist. Use the package’s empty-record handling to normalize that path and return a predictable empty collection, message, or response shape.

Implementation Patterns

Use the package at the boundary where empty model results become user-visible or API-visible.

  • Controller/API responses: wrap list queries so a zero-record result returns a consistent payload, for example 200 with data: [], or a domain-specific 404, depending on your API semantics. Keep the decision in one place rather than scattering isEmpty() checks across controllers.
  • Blade/UI empty states: pair the package’s empty handling with a single empty-state partial. This avoids duplicating @forelse/@empty blocks across index pages.
  • Query-level guards: when the package exposes a helper, scope, or trait method for empty results, use it immediately after building the query. Avoid calling ->get() and then manually checking count() in every caller.
  • Pagination: if the package integrates with paginators, verify both total() === 0 and items() === []. Empty paginators often still render pagination links unless explicitly suppressed.
  • Console commands and jobs: guard against empty model sets before looping. A command that processes “all eligible records” should exit cleanly when none exist, not fail or emit misleading success output.
  • Testing: add feature tests for the zero-record case alongside the happy path. Use a fresh database or a model factory state that guarantees no rows. Assert the response status, payload shape, and user-facing message.
  • Integration with filters: distinguish “no records exist at all” from “no records match the current filters.” If the package only handles the former, keep a separate filtered-empty path in your application code.
  • Version pinning: because this is a 0.1.x package, pin to 0.1.4 or use a tight constraint until the API stabilizes. Review each patch release before upgrading.

Gotchas and Tips

  • The release note is terse. Confirm in code or tests whether “handling” means returning an empty collection, a default model, a view, an exception, or a response object. Do not assume the behavior.
  • “No records for a model” is not the same as “no records matching the query.” Check whether the package inspects the model globally or the specific query result.
  • Do not let empty handling swallow real failures. A database error, authorization failure, or invalid query should not silently become an empty result.
  • Pagination empty states are a frequent source of confusion. Check total(), count(), items(), and whether the package alters paginator metadata.
  • Authorization still belongs in your application. Empty-result handling should not bypass policies or gates that would otherwise hide records.
  • If you cache list responses, be careful with negative caching. An empty result cached indefinitely can outlive the creation of the first record; use short TTLs or explicit invalidation.
  • Eager loading still matters. Empty handling should not encourage removing with() calls from the non-empty path.
  • Debugging tip: log or dump the underlying query with toSql() and getBindings() when the package reports an empty result unexpectedly. Also check whether global scopes or soft deletes are filtering rows.
  • Config quirks: if the package publishes config, run php artisan config:clear after changes. Check for model-to-handler mappings that may need registration.
  • Extension points: look for publishable views, response classes, traits, or macros that let you override the default empty-state output. Prefer extending those over editing vendor files.
  • Because this is an early release, keep an eye on the changelog for behavioral changes in patch versions and add regression tests around the empty-record path so upgrades are safer.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo