Download the PHP package opscale/fields without Composer

On this page you can find all versions of the php package opscale/fields. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package fields

opscale/fields

Family of custom fields for Laravel Nova. The first member is AI: a conversational assistant that lives inside a resource form, chats with the user, and proposes values for the other fields of the form. The user accepts or discards each proposal — the AI never writes anything by itself.

The field is headless: no database column, a no-op on save, forms only. If the panel's JavaScript ever fails, the form keeps working — the assistant is strictly additive and can be ignored entirely.

Requirements

Dependency Version Why pinned
PHP ^8.3 required by laravel/ai
Laravel ^12 | ^13 required by laravel/ai
laravel/nova ~5.9.0 (pinned) accepted values are pushed into native fields through Nova's internal event bus ({formUniqueId}-{attribute}-value / -change). That naming is undocumented API; re-verify it in vendor/laravel/nova/public/app.js (getFieldAttributeValueEventName, listenToValueChanges) and the laravel-nova npm mixins (src/mixins/FormField.js) before raising the constraint.
laravel/ai ^0.9 streams the Vercel UI Message Stream v1 (x-vercel-ai-ui-message-stream: v1)
@ai-sdk/vue (bundled) ~4.0.22 + ai ~7.0.22 consumes exactly that protocol version — bump both sides of the protocol together

Installation

Publish laravel/ai's config and conversation tables (the field persists chat history with RemembersConversations):

Configure your provider key on the server — it never reaches the browser:

Writing an agent

Extend FieldAgent: describe your domain in persona() and expose lookup tools for relationship fields. Everything else (proposal schema, current form values, server context, the proposeFields tool, conversation memory) is injected by the field's endpoint.

Relationship fields are proposed as ID + display label: the ID is what fills the field, the label is what the user sees before accepting. The base instructions forbid inventing IDs — the model must pick them from a lookup tool.

The compression ratio

If the assistant asked one question per field, this would just be a slower form. The base prompt pushes the opposite: few high-level questions, many derived fields. Real exchange with the ProductCopilot demo (2 user answers → 6 fields proposed):

User: I want to list the wireless mouse we just received. Assistant: What price point and roughly how many units did you receive? User: Around $49.99, we got 200 units. Assistant: (proposes via proposeFields)

  • Name → "Wireless Pro Mouse"
  • Description → "Precision wireless mouse with ergonomic design..."
  • Price → 49.99
  • SKU → "WPM-WL-001"
  • Stock → 200
  • Category → Peripherals (ID 1, from searchCategories)

The user accepts all six, edits any of them by hand, or types "make the description more formal" to get a refined re-proposal — all inside the panel.

How it works

The model never returns text that needs parsing: proposals arrive as a typed tool-input-available part. proposeFields.handle() exists because laravel/ai's Tool contract requires it, but it is deliberately inert — it only acknowledges, executing nothing.

Footguns

  1. Proxy buffering. The endpoint already sends X-Accel-Buffering: no, but nginx setups with proxy_buffering on will still swallow the stream and deliver everything at once when it finishes. It looks like a code bug; it is not. Configure:

  2. PHP-FPM workers. Every open SSE stream holds a worker. Fine for a Nova panel (internal users, low concurrency), but keep a bound on it: the field passes maxDuration (default 120s) as the stream timeout so a stuck stream frees its worker. Tune per field with ->maxDuration(seconds) and size pm.max_children accordingly.

  3. Nova is pinned (~5.9.0) because accepting a proposal uses Nova's internal event bus (see Requirements). When bumping Nova, re-check the event names before widening the constraint.

  4. Relationship fields. A BelongsTo is filled with an ID, never a label, so proposals carry both (value = ID, display = label). Known v1 limitation: Nova 5.9's BelongsTo form component does not subscribe to the -value event bus, so accepting a relation proposal may not visually fill the combobox — the user sees the proposed record's name in the panel and can select it manually. Text, textarea, number, markdown and similar native fields do subscribe and fill instantly.

Out of scope (v1)

Development

The workbench ships a Product resource wired to the ProductCopilot demo agent (workbench/app/Agents).

Package layout

src/AI.php (class) and src/AI/ (support namespace) coexist on purpose — valid PSR-4, do not flatten. The package is multi-field by design: new fields add components to the same bundle, routes to the same group, and registrations to the same provider.


All versions of fields with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
laravel/ai Version ^0.9.0
laravel/nova Version ~5.9.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package opscale/fields contains the following files

Loading the files please wait ...