Configuration
After publishing the config with php artisan vendor:publish --tag="lattice-config", you can tune Lattice in config/lattice.php.
Discovery
Section titled “Discovery”Lattice automatically discovers form, table, fragment, action, layout, and page definitions by scanning the configured paths for classes carrying the matching attribute:
'discover' => [ base_path('app'),],List every path Lattice should scan. Discovery walks the files directly, so no namespace mapping is needed.
Registering definitions explicitly
Section titled “Registering definitions explicitly”Instead of (or in addition to) discovery, register definition classes at runtime through the Lattice facade — useful from a service provider:
use Lattice\Lattice\Facades\Lattice;
Lattice::forms([\App\Forms\ContactForm::class]);Lattice::tables([\App\Tables\UsersTable::class]);The same method exists for fragments, actions, bulkActions, layouts, pages, and remoteSources.
Endpoints and middleware
Section titled “Endpoints and middleware”Each definition type is served by a dedicated endpoint with its own middleware stack. The defaults all run behind web and auth:
| Type | Endpoint | Middleware |
|---|---|---|
| Forms | lattice/forms/{form} |
['web', 'auth'] |
| Tables | lattice/tables/{table} |
['web', 'auth'] |
| Fragments | lattice/fragments/{fragment} |
['web', 'auth'] |
| Actions | lattice/actions/{action} |
['web', 'auth'] |
| Bulk actions | lattice/bulk-actions/{bulkAction} |
['web', 'auth'] |
| Remote sources | lattice/remote-sources/{source}/token |
['web', 'auth'] |
| Notifications | lattice/notifications |
['web', 'auth'] |
Change the endpoint or middleware stack per type:
'forms' => [ 'endpoint' => 'lattice/forms/{form}', 'middleware' => ['web', 'auth'],],The notifications block also takes per_page, polling_interval, and prune_after_days — see
Notifications.
File uploads are stored through Laravel’s filesystem. Pending uploads live under a temporary prefix and are served with short-lived signed URLs until the form is submitted:
'files' => [ 'disk' => env('LATTICE_FILES_DISK', 'public'), 'temp_prefix' => 'tmp', 'url_ttl' => 5,],disk— the storage disk uploads are written to.temp_prefix— the directory pending (not-yet-finalized) uploads are placed in.url_ttl— how long, in minutes, a temporary signed file URL stays valid.
Internationalization
Section titled “Internationalization”The locales Lattice exposes to the client and the i18n runtime:
'i18n' => [ 'locales' => ['en'], 'preload_locales' => [],],locales— the locales available to the application.preload_locales— locales whose translations are bundled into the initial page payload instead of being fetched on demand. Leave empty to load every locale lazily.
Realtime
Section titled “Realtime”Toggles the realtime broadcasting layer. When disabled, page listeners are not serialized to the client:
'realtime' => [ 'enabled' => env('LATTICE_REALTIME_ENABLED', true),],Security
Section titled “Security”Component references embedded in the page payload are signed. security.ref_lifetime controls how long, in minutes, a signed reference stays valid:
'security' => [ 'ref_lifetime' => 30,],TypeScript
Section titled “TypeScript”Where php artisan lattice:typescript writes the generated type definitions, and the module name they are published under:
'typescript' => [ 'output' => resource_path('js/lattice/generated.d.ts'), 'module' => '@lattice-php/lattice',],