Skip to content
This documentation is in construction.

Overview

Epsicube Schema is the framework’s declarative data description layer. It is used to define structured data once, then reuse the same definition for validation, options management, Filament UIs, JSON Schema export, and interactive CLI prompts.

The package is built around Epsicube\Schemas\Schema and a set of property classes in Epsicube\Schemas\Properties\*.

  • A typed description of a data structure.
  • A single source of truth for defaults and constraints.
  • Runtime validation with Laravel validators.
  • Automatic export to JSON Schema.
  • Automatic export to Filament components.
  • Automatic export to Laravel Prompts forms.
  • Reusable option definitions for Epsicube modules.

At a high level, a schema is:

  1. A unique identifier.
  2. Optional human metadata: title and description.
  3. A map of named properties.

Each property describes:

  • its type
  • whether it is optional
  • whether it accepts null
  • whether it has a default value
  • any type-specific constraints
  • StringProperty
  • BooleanProperty
  • IntegerProperty
  • FloatProperty
  • EnumProperty
  • ObjectProperty
  • ArrayProperty
  1. Create a schema with Schema::create() and append properties with ->append([...]).

  2. Use ->validated($data) or ->toValidator($data) to validate incoming data and apply defaults.

  3. Use the same schema to generate:

    • JSON Schema with ->toJsonSchema()
    • Filament components with ->toFilamentComponents(...)
    • CLI prompts with ->toExecutedPrompts(...)

Defining Schemas

Learn the core model: identifiers, properties, optional, nullable, defaults, nested objects, and schema composition.

Property Types

Browse a structured reference of every built-in property with signatures, fluent methods, behaviors, and examples.

Using Schemas

See how to validate payloads, apply defaults, scope schemas with only() and except(), and use them in runtime flows.

Export Schemas

Understand how the same schema becomes JSON Schema, Filament components, Laravel prompts, and Laravel validators.

  • Start with Defining Schemas if you are creating a schema from scratch.
  • Jump to Property Types when you need the exact API of a property class.
  • Use Using Schemas for runtime validation, defaults, and schema slicing.
  • Finish with Export Schemas when the schema must drive UI, CLI, or contracts.
Terminal window
composer require epsicube/schemas