© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
11 replies
ramclospapp

Create multiple records when click createAction

I have a CampaignCouponsRelationManager to add a coupon under the campaign.
i want that when the user clicks on "Create coupon", 100 coupons will be automatically created without opening the form in the modal.

What is the recommended way to do this?
Solution
Assuming you are wanting to bulk create 100 coupons directly, you can use an normal header action:

https://filamentphp.com/docs/3.x/tables/actions#header-actions

Action::make('insert_coupons')
  ->form([TextInput::make('qty')->numeric()])
  ->action(function($data, $livewire) {
      $parent_id = $livewire->parent_recorrd_id;
      $qty = (int) $data['qty'];
      // Build a loop and create all the records as normal

       // Send notification of records created
    })
Action::make('insert_coupons')
  ->form([TextInput::make('qty')->numeric()])
  ->action(function($data, $livewire) {
      $parent_id = $livewire->parent_recorrd_id;
      $qty = (int) $data['qty'];
      // Build a loop and create all the records as normal

       // Send notification of records created
    })
Actions - Table Builder - Filament
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Create multiple records at once
FilamentFFilament / ❓┊help
3y ago
bug: when pressing create button multiple times creates duplicate records
FilamentFFilament / ❓┊help
3y ago
multiple CreateActions?
FilamentFFilament / ❓┊help
3y ago
Create multiple records at once (pseudo code)
FilamentFFilament / ❓┊help
3y ago