Skip to content

Pyro Field Types

Pixney-William edited this page Oct 9, 2017 · 6 revisions

Pyro Field Types

Image Field Type

"example" => [
    "type"   => "anomaly.field_type.image",
    "config" => [
        "folders"       => null,
        "aspect_ratio"  => null,
        "min_height"    => 400
    ]
]

WYSIWYG Field Type

"example" => [
    "type"   => "anomaly.field_type.wysiwyg",
    "config" => [
        "default_value" => null,
        "configuration" => "default",
        "line_breaks"   => false,
        "sync"          => true,
        "height"        => 500,
        "buttons"       => [],
        "plugins"       => [],
    ]
]

Text Field Type

"example" => [
    "type"   => "anomaly.field_type.text",
    "config" => [
        "type"          => "text",
        "default_value" => null,
    ]
]

Email Field Type

"example" => [
    "type"   => "anomaly.field_type.email",
    "config" => [
        "default_value" => null
    ]
]

Example using fields in migrations

$imageField = $this->fields()->create([
    "name"        => "Contact Block Image",
    "slug"        => "contact_block_image",
    "description" => "",
    "locked"      => false,
    "type"        => "anomaly.field_type.image",
    "namespace"   => "grid",
    "config"      => [
        "folders"      => null,
        "aspect_ratio" => "1:1",
        "min_height"   => 400,
    ],
]);