Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Twill Laravel Package

area17/twill

Twill is an open-source Laravel package for building a custom CMS fast. It provides a polished admin UI with prebuilt features and Vue components, stays flexible and extensible, works headless or integrated, and lets you use your own models with no lock-in.

View on GitHub
Deep Wiki
Context7

Validating blocks

There are 2 ways to add field validation to blocks. You have to use one or the other. If the blade directive is present it will be used over the class.

Blade directive

The first and easiest option is to add the directives to your block form blade file:

There are 2 possible directives to use, these can be combined.

[@twillBlockValidationRules](https://github.com/twillBlockValidationRules) for validating non translatable fields.

[@twillBlockValidationRulesForTranslatedFields](https://github.com/twillBlockValidationRulesForTranslatedFields) for validating translatable fields.

Both take an array of [field => rules] values. All Laravel validation rules are supported.

Example:

[@twillBlockValidationRules](https://github.com/twillBlockValidationRules)([
    'text' => 'required'
])
[@twillBlockValidationRulesForTranslatedFields](https://github.com/twillBlockValidationRulesForTranslatedFields)([
    'title' => 'required'
])

Block class

If you need more control you can use the block class to set validation rules, or even hook into the validation process.

See Block classes documentation for more details about the block class.

<?php

namespace App\Twill\Block;

use A17\Twill\Services\Blocks\Block;

class ExampleBlock extends Block
{
    public $rulesForTranslatedFields = [
        'title' => 'required|string',
    ];

    public $rules = [
        'text' => 'required',
    ];
}
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport