🔡Form

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

Last updated