matt-daneshvar / laravel-survey

Create and manage surveys within your Laravel app.
MIT License
250 stars 50 forks source link

Multi Select type does load check boxes it loads text box #40

Closed zaloAustine closed 1 year ago

zaloAustine commented 1 year ago

$valid = $request->validate([ 'options1s' => 'required', 'options2s' => 'required', 'options3s' => 'required', 'options4s' => 'required' ]);

                $survey->questions()->create([
                    'content' => $question,
                    'type' => 'mutliselect',
                    'options' => [$request->options1s, $request->options2s, $request->options3s, $request->options4s]
                ]);

While building the survey form the type "mutliselect" doesn't work as expected

zaloAustine commented 1 year ago

Found out the name in the documentation is mis directing "mutliselect"

matt-daneshvar commented 1 year ago

Hi @zaloAustine, thanks for using the package.

I understand the name "multiselect" for the functionality provided can be misleading; this was briefly debated in #22 too. We can definitely rename it to something else in future versions.

I'm not sure if I quite understand what you were trying to achieve with this snippet:

'options' => [$request->options1s, $request->options2s, $request->options3s, $request->options4s]

But I'd generally recommend creating your own custom question types if the question types coming with the package don't meet your needs.