Skip to content

Automatically generate Tall-forms and Tall-data-tables for each of the models specified in your draft file.

Notifications You must be signed in to change notification settings

tanthammar/tall-blueprint-addon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Feb 18, 2021
ef7a816 · Feb 18, 2021

History

94 Commits
Dec 9, 2020
Feb 18, 2021
Feb 18, 2021
Feb 18, 2021
Apr 16, 2020
Apr 17, 2020
Apr 16, 2020
Feb 18, 2021
Feb 10, 2021
Apr 16, 2020

Repository files navigation

TALL-forms Blueprint Addon

Auto generate TALL-forms for all models with the php artisan blueprint:build command.

This plugin is based on Blueprint Nova Addon by Krishan König.

What you get

  • Consider the code you get as a mockup/draft. It won't work as is. You'll have to review and finalize the field declarations.
  • You will get a single form component for each model. It's up to you to split it in two components if you need separate forms for create/update forms.

Early version!

  • Relationship fields are outputted as Repeaters, Selects or MultiSelect. This will change when I create required fields in TALL-forms
  • Review generated code, it's not perfect :)

Requirements

  • tall-forms >= v7.8.4
  • blueprint >= 1.20

Installation

  • Install Laravel, Livewire and TALL-forms
  • Then install this package and Blueprint via composer:
composer require --dev tanthammar/tall-blueprint-addon

Usage

Refer to Blueprint's Basic Usage to get started. Afterwards you can run the blueprint:build command to generate Tall-forms automatically. Try this example draft.yaml file.

# draft.yaml
models:
    Post:
        author_id: id foreign:users
        title: string:400
        content: longtext
        published_at: nullable timestamp
        relationships:
            HasMany: Comment

    Comment:
        post_id: id foreign
        content: longtext
        published_at: nullable timestamp

controllers:
    Post:
        index:
            query: all
            render: post.index with:posts
        create:
            render: post.create
        store:
            validate: title, content, author_id
            save: post
            dispatch: SyncMedia with:post
            notify: post.author ReviewPost with:post
            send: ReviewPost to:post.author with:post
            flash: post.title
            fire: NewPost with:post
            redirect: post.index
        update:
            update: post
            dispatch: SyncMedia with:post

        destroy:
            flash: post.title
            send: SupportPostDeleted to:support with:post
            delete: post
            redirect: post.index

    Comment:
        resource

Configuration

You may publish the configuration with the following command:

php artisan vendor:publish --tag=tall-blueprint-config

Timestamp fields

To disable the generation of timestamp fields for all forms set this option to false.

Contribution

This is open source, I'll gladly accept every effort to contribute.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Automatically generate Tall-forms and Tall-data-tables for each of the models specified in your draft file.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages