© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
2 replies
KM Nurunnabi

Want to achieve Livewire form dynamically

Hey. I have a livewire component with few forms is given below:

<?php

namespace App\Livewire\User\Quizzes;

use App\Livewire\Forms\User\AnswerForm;
use App\Livewire\Forms\User\OptionForm;
use App\Livewire\Forms\User\QuestionForm;
use App\Livewire\Forms\User\QuizForm;
use App\Models\Quiz;
use Livewire\Component;

class CreateQuiz extends Component
{
public QuizForm $quizForm;

public QuestionForm $questionForm;

public function save()
{
dd($this->questionForm->all());
$this->validate();
Quiz::create($this->quizForm->all());
}

public function render()
{
return view('livewire.user.quizzes.create-quiz');
}
}
But question is, quiz can have mutiple questions. That mean I need a collection of QuestionForm class. But I don't know how can I acquired that. Does anybody knows how to take an array of QuestionForm class?

Then how can I validate array of Form?
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

I want to add data to form livewire
FilamentFFilament / ❓┊help
2y ago
Livewire Form Color
FilamentFFilament / ❓┊help
2y ago
Adding form to livewire component
FilamentFFilament / ❓┊help
3y ago
Action to switch form tabs dynamically
FilamentFFilament / ❓┊help
12mo ago