Skip to content

Closure-evaluated, conditional props #3

Closed

Description

@n4ff4h

Like Filament, every prop can be a closure evaluated with injected arguments ($get, $set, $record, $operation, $state, $livewire-free equivalents): ->visible(fn (Get $get) => $get('type') === 'company'), ->options(fn ($record) => …). Dependent fields re-evaluate when their dependencies change, in Blade (small JS) and Inertia (partial reload or an evaluation endpoint).

Activity

  1. added
    next-genNext-gen Javaabu packages
    featurePackage feature from the spec
    on Nov 4, 2026
  2. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    CollaboratorAuthor

    Done in 2e6b66a (server side), 53cbb92 (React) and 52da11f (Blade script); docs in closures-and-conditions.md and live-fields.md. Every prop takes a closure, with arguments injected by name ($get, $set, $state, $old, $record, $model, $operation, $component, $form) or by type. There are two ways to re-evaluate. Declarative conditions (visibleWhen and friends) are checked in the browser through forms' conditional-wrapper, with no round trip, and on the server for validation and saving. Live fields (->live(), afterStateUpdated() with $set) post the state to an evaluation endpoint (Route::stencil()) carrying an encrypted, user-bound, expiring token. Blade replaces only the components that changed; React re-renders from the returned schema. I chose the endpoint over Inertia partial reloads because it works the same for both drivers and doesn't depend on the page's controller. The trade-off is that live fields need a form class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurePackage feature from the specnext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions