Download the PHP package tdwesten/statamic-builder without Composer

On this page you can find all versions of the php package tdwesten/statamic-builder. 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 statamic-builder

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Github

Statamic Builder

The Statamic Builder speeds up building Statamic sites. It offers a clear method to define sites, blueprints, fieldsets, collections, navigations and taxonomies using PHP classes. This approach enhances code readability and maintainability compared to writing YAML files.

Features

Installation

You can install this addon with composer:

Requirements

Configuration

You can publish the configuration file using:

The configuration file allows you to manually register components or enable auto-discovery.

Options

Option Description
blueprints Manual registration of blueprints, grouped by namespace.
fieldsets Manual registration of fieldsets.
collections Manual registration of collections.
taxonomies Manual registration of taxonomies.
globals Manual registration of global sets.
sites Manual registration of sites.
navigations Manual registration of navigations.
asset_containers Manual registration of asset containers.
auto_registration Enable or disable auto-discovery of components.
auto_discovery Define custom paths for auto-discovery of each component type.

Auto Registration & Discovery

Enable auto_registration in config/statamic/builder.php to automatically find components in your app/ directory.

Discovery Requirements

For components to be auto-discovered, they must implement certain static methods:

Blueprints and Fieldsets

Creating a Blueprint

  1. Generate a blueprint:

  2. Define your fields in the registerTabs method:

Creating a Fieldset

  1. Generate a fieldset:

  2. Define fields:

Collections, Taxonomies, and Globals

Collections

Generate a collection:

Most methods in BaseCollection now have default implementations, so you only need to override what you want to change (e.g., route(), sites(), template()).

Taxonomies

Generate a taxonomy:

Global Sets

Global sets can be defined as PHP classes. This allows you to manage global variables and their localization through PHP classes.

  1. Generate a global set:

  2. Configure your global set:

By default, the global set will use the default site. You can override the sites() method to support multiple sites.

Blueprint for Global Sets

To define fields for your global set, create a blueprint with the same handle in the globals namespace:

Asset Containers

Generate an asset container:

Most methods in BaseAssetContainer have default implementations, so you only need to override what you want to change (e.g., disk(), allowUploads(), createFolders()).

Navigations

Generate a navigation:

Multi-site Support

Generate a site:

Working with Foreign Fieldsets

When working with a mixed codebase or utilizing other Statamic addons, you can import their fieldsets using ForeignFieldset and ForeignField.

Supported Field Types

Statamic Builder supports all core Statamic field types. Use the make($handle) method to instantiate them.

Field Type Class
Array Arr
Assets Assets
Bard Bard
Button Group ButtonGroup
Checkboxes Checkboxes
Code Code
Collections Collections
Color Color
Date Date
Dictionary Dictionary
Entries Entries
Float FloatVal
Form Form
Grid Grid
Group Group
Hidden Hidden
HTML Html
Icon Icon
Integer Integer
Link Link
Lists Lists
Markdown Markdown
Money Money
Navs Navs
Number Number
Password Password
Radio Radio
Range Range
Rating Rating
Replicator Replicator
Reveal Revealer
Section Section
Select Select
Sites Sites
Slug Slug
Spacer Spacer
Structures Structures
Table Table
Taggable Taggable
Taxonomies Taxonomies
Template Template
Terms Terms
Text Text
Textarea Textarea
Time Time
Toggle Toggle
User Groups UserGroups
User Roles UserRoles
Users Users
Video Video
Width Width
YAML Yaml
... and many more.

Custom Fields

You can create a custom field by extending the Field class or using the generator:

Artisan Commands

Command Description
make:blueprint Create a new Blueprint class.
make:fieldset Create a new Fieldset class.
make:collection Create a new Collection class.
make:taxonomy Create a new Taxonomy class.
make:global-set Create a new Global Set class.
make:navigation Create a new Navigation class.
make:asset-container Create a new Asset Container class.
make:site Create a new Site class.
statamic-builder:export Export definitions to YAML.

Exporting to YAML

If you need to generate standard Statamic YAML files from your PHP definitions:

Changes

Version 1.1.0 (Refactoring & Auto-discovery)

Version 1.2.0 (Enhanced Components & Commands)


All versions of statamic-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/support Version ^12.0|^13.0
laravel/framework Version ^12.0|^13.0
statamic/cms Version ^6.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 tdwesten/statamic-builder contains the following files

Loading the files please wait ...