👻
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
  1. Helpers

Modal

it's easy to create a new custom modal on the resource and fire it using Action::class by set it ->modal(modal_name) so on the action click it will open the modal

Using

to create a new modal on the resource you can use Modal::class to create a new modal on the selected resource and pass this modal class to resource method modals() like

public function modals()
{
    return [
        Modal::make('generate')->title(__('Generate Permissions'))->type('success')
            ->rows([
                Row::make('guard_name')->label(__('Guard Name'))->get(),
            ])
            ->buttons([
                Action::make('generate')->label(__('Generate'))->action('roles.generate')->type('success')->render(),
            ])
            ->render(),
    ];
}

on the ->rows() method to set the schema of the form show on modal and on ->buttons() method to set the actions on modal like save , update ..etc

PreviousActionsNextTranslations

Last updated 2 years ago

🌟