© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•14mo ago•
1 reply
sohail

how to set the data from input to a form modal

USING FORM & ACTION BUILDER

Hi i have a permission
tags input
tags input
and i also have action inside that input the open a modal and from the user can select the permision and the they will see it in tags input i can set the permission to the tags input from the modal but when i open the modal the permission are alway unchecked how can i set the permission form the tags input the the selected permission are checked

my code

  public function mount()
    {
        $this->form->fill(['permissions' => 'can:edit', 'can:create'])
   }

 public function form(Form $form): Form
    {
        return $form->schema([
         TagsInput::make('permissions') 
          ->hintAction(
              Action::make('add_permissions')
                  ->form([
                     CheckboxList::make('permission_name')
                          ->options($this->permissionsNames)
                  ])
                  ->icon('fal-plus')
                  ->action(function (Set $set, $data) {
                      $set('permissions', [
                          ...$data['permission_name']
                      ]);
                  })
          )
   }
  #[Computed(persist: true)]
    private function permissionsNames(): array
    {
        return Permission::whereIsGlobal(false)
          ->pluck('name', 'name')
          ->toArray();
    }
  public function mount()
    {
        $this->form->fill(['permissions' => 'can:edit', 'can:create'])
   }

 public function form(Form $form): Form
    {
        return $form->schema([
         TagsInput::make('permissions') 
          ->hintAction(
              Action::make('add_permissions')
                  ->form([
                     CheckboxList::make('permission_name')
                          ->options($this->permissionsNames)
                  ])
                  ->icon('fal-plus')
                  ->action(function (Set $set, $data) {
                      $set('permissions', [
                          ...$data['permission_name']
                      ]);
                  })
          )
   }
  #[Computed(persist: true)]
    private function permissionsNames(): array
    {
        return Permission::whereIsGlobal(false)
          ->pluck('name', 'name')
          ->toArray();
    }
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Open another form modal from a form modal
FilamentFFilament / ❓┊help
10mo ago
How do I pass form modal input back to the main form?
FilamentFFilament / ❓┊help
3y ago
How to open a modal from a Form Wizard?
FilamentFFilament / ❓┊help
2y ago
Set Repeater Data from Action Form
FilamentFFilament / ❓┊help
2y ago