👻
VILT Stack Generator
  • Get Started
    • 👻Overview
    • 💻Environment Setup
    • 🚀Install
  • Generate
    • 🧠Resource
    • 🔥Action
    • 🧩Modal
    • 📈Widget
    • 📏Route
    • 🖥️Views
    • 🔒Roles
  • Resource
    • 🔦Using
    • 🪝Hooks
    • 📤Import & Export
  • Builders
    • 🔡Form
    • 📺Table
    • 📄Page
  • Components
    • 💫Using
    • 🆎Text
    • 🔤Textarea
    • 🔠Rich
    • 🔢Number
    • 📞Tel
    • ✉️Email
    • 🔄Toggle
    • 🖌️Color
    • 📅Date
    • ⌛Time
    • ⏲️DateTime
    • ⚡Select
    • 🔁Repeater
    • 📑Schema
    • ✨Section
    • 🖼️Media
    • 💟HasOne
    • 🎁Relation
  • Managers
    • 🔤Translation
    • 📖Menu
    • ♠️Share
  • Helpers
    • ⚠️Alert
    • 💻Render
    • 🌠Actions
    • 🌟Modal
  • Plugins
    • 🔤Translations
    • 📀Settings
    • 📖Menus
    • 🔔Notifications
    • 💳Payment
    • 🏗️Build Plugins
  • Learning
    • 🙏Task To Get Start
    • 🚨CI/CD
    • 🦄Awesome TailwindCSS
Powered by GitBook
On this page
  • Page View
  • Tabs View
  • From Components
  1. Builders

Form

PreviousImport & ExportNextTable

Last updated 2 years ago

our framework has a form class that can use to set the form type between modal or tabs, page so you can convert a form to multi-steps with just the backend method

Page View

you can use the form on views when you make it a page like

public function form(): FormComponent
{
   return FormComponent::make('page');
}

after that use this command to generate your views

php artisan vilt:views

it will generate 3 views for use on the Resources/views, you can custom it as you like.

Tabs View

to build a tabs form you need to use the Tabs class with Form class on the resource like

public  function form(): FormComponent
{
    return FormComponent::make('tabs')->tabs([
        Tab::make('basic')->label(__('Basic')),
        Tab::make('media')->label(__('Media')),
        Tab::make('amenities')->label(__('Amenities')),
        Tab::make('units')->edit(false)->label(__('Units')),
    ])->label(__('Create Property'))->get();
}

and to add the row on the selected tab it's easy to set ->tab() to the name of the tab

From Components

we are using rows on every resource we build to manage the form builder and we have a lot of methods and types for these rows

🔡