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

Form Requests

Classic Laravel 5+ form request validation.

Once you generated the module using Twill's CLI module generator, it will also prepare the App/Http/Requests/Twill/ModuleNameRequest.php for you to use. You can choose to use different rules for creation and update by implementing the following 2 functions instead of the classic rules one:

<?php

public function rulesForCreate()
{
    return [];
}

public function rulesForUpdate()
{
    return [];
}

There is also an helper to define rules for translated fields without having to deal with each locales:

<?php

$this->rulesForTranslatedFields([
 // regular rules
], [
  // translated fields rules with just the field name like regular rules
]);

There is also an helper to define validation messages for translated fields:

<?php

$this->messagesForTranslatedFields([
 // regular messages
], [
  // translated fields messages
]);

Once you defined the rules in this file, the UI will show the corresponding validation error state or message next to the corresponding form field.

Validating repeater fields

To validate repeater fields added to your model you can reuse the same rulesForCreate and rulesForUpdate methods.

If your repeater is named accordion_item and you want to add validation to the headline field you can use:

public function rulesForCreate()
{
    return ['repeaters.accordion_item.*.header' => 'required'];
}

Alternatively if your field is translatable you can use the helpers as defined above:

public function rulesForUpdate()
{
    return $this->rulesForTranslatedFields([], [
        'repeaters.accordion_item.*.header' => '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