npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nickwelsh/zero-for-laravel

v0.4.0

Published

Generated Laravel model contracts and React bindings for Zero.

Readme

@nickwelsh/zero-for-laravel

Typed model queries, automatic optimistic CRUD, and React bindings for Zero for Laravel. Requires the matching nickwelsh/zero-for-laravel Composer package and @rocicorp/zero 1.10.0. React 18/19 and FormBraid are optional peers. Query-only consumers do not need FormBraid.

Install the current stable release, v0.4.0, in your Laravel application:

composer require nickwelsh/zero-for-laravel
pnpm add @nickwelsh/zero-for-laravel
pnpm add --save-exact @rocicorp/[email protected]
php artisan vendor:publish --tag=zero-config

Keep the Composer and JavaScript packages on matching release versions, and use Zero cache 1.10.0 with the pinned Zero client.

import { Task } from './zero/generated';
import { useData, useMutation } from '@nickwelsh/zero-for-laravel/react';

const data = useData(Task.query().all());
const create = useMutation(Task.create());
create({ title: 'Hello' });

Use these hooks inside Zero's ZeroProvider. The root export is framework independent; /react adds React hooks, filter controls, and the native provider. Laravel generates the schema and allowed operations from your model definitions.

useMutation also returns a Formbraid descriptor. Pass it to your application's registered Form; selected relations add prefixed fields and share one mutation:

const { form } = useMutation(Party.create().with('person'));
return <Form form={form} />;

Formbraid owns edits and submission. The callback restores date strings to Dates, waits for server acceptance, and maps field errors. The client uses structural producer declarations and an optional @formbraid/core peer. For forms, install @formbraid/core@^0.1.0 and @formbraid/react@^0.1.0 for the form runtime. Collections require an application array component; see the mutations guide for component names and defaults.

See the installation guide and API examples for model attributes, policies, publication setup, authenticated endpoints, client lifetime, and supported constraints.

v0.3.0 additions

Selections accept typed .filter(name, value) as well as filter objects. toPlain(result.data) recursively unwraps snapshots into readonly decoded data. useData preserves completed empty results, live committed sort ordering, and stable decoding across equivalent inline selections. Infinite results distinguish exhausted from capped and expose stopReason; the API grows a bounded live window rather than traversing an entire dataset.

Explicit Laravel domain actions generate typed native Zero mutations, server-only by default, with optional deterministic optimistic callbacks. See the domain mutation guide.