Skip to main content

Mental models

These are the main pieces that make up Qore.

When you build a feature, the usual order is: create the Eloquent model and migration, add a resource, choose fields, seed permissions, add a policy and place the resource in the menu.

Resource

A Resource defines CRUD behaviour for a Laravel model.

It exists so fields, routes, permissions, forms, tables, actions and layouts can be described once.

For example, UserResource defines the user fields, actions and detail layout.

Field

A Field describes one model value across forms, index tables, filters, detail pages and exports.

It exists so validation, mutation, display value, filtering and visibility stay together.

Qore includes fields such as TextField, SelectField, DateField, FileField and relation fields.

Node

A Node is a backend-described UI block. It can be a CardNode, FlexNode, FormNode, ModalNode, SubNode or any other registered component.

It exists so PHP can return UI structure and React can render it consistently. Fields are nodes too.

Every node response is handled by NodeManager. It reads request state, URL params and hidden nodes, runs the node request/response lifecycle, and serializes the root node back to React. That is why a backend node can react to a click, update a form field, hide another node or ask the frontend to navigate without becoming a custom API format. See NodeManager and Forms.

Form

A FormNode wraps fields and submit behaviour. The companion Form object is passed into field callbacks so fields can read other field values, set response-only values and trigger dependent updates.

Use this mental model: FormNode describes the form, Form represents the current request state for that form, and fields own their own validation, default values, display values and mutation logic.

Eloquent Table

An EloquentTableNode is a backend-described table for an Eloquent query.

It exists so a table can keep its fields, query, filters, sorting, pagination, row actions, bulk actions, tabs and user table settings in one node. Resource index pages use it through ResourceTable, and custom pages can use it directly when the table is part of a special workflow.

Use this mental model: fields describe the columns, the query describes the rows, TableState describes the current frontend interaction, and EloquentTableNode turns those into a paginated node response.

Globals

Globals are app-wide data returned by the backend globals endpoint. The frontend retrieves them in useAppGlobals(), immediately after the authenticated user is fetched from me.

The payload comes from qore()->getGlobals($append) and includes:

  • registered resources from registerResource();
  • registered modules;
  • user preferences;
  • broadcasting, global-search and notification feature flags;
  • unread notification count;
  • any extra values appended by the controller.

The frontend stores the result in useGlobalStore, persisted as globals-storage.

Globals exist so app-level UI can read shared state without each page fetching it again.

Qore configuration

The qore() helper exposes the framework singleton. In Skeleton this is configured from AppServiceProvider: resources are registered, auth middleware is set, login/logout callbacks are wired and feature flags can be enabled from application config.

The menu and permissions are separate from the resource definition. Registering a resource teaches Qore that it exists; policies, permissions and menu items decide what the user can see and do.