Sharing a questionnaire

I want to create dynamic form using @Lara Zeus form builder but this form is more of a questionanire I need to copy and share the link to people to answer through am kindly asking id thats possible
74 Replies
Lara Zeus
Lara Zeus4mo ago
yes you can check the demo and create a test form and see if its suitable for your use case
codeartisan
codeartisan4mo ago
@Lara Zeus do you have the date data type am trying out a sample form to check if it fits our use case I have seen it The questionnaire fits my use case but how do I options to the radio buttons , select options to the select menu and work out conditional rendering @Lara Zeus how can we handle repeater please
Lara Zeus
Lara Zeus4mo ago
there is a Dynamic Textbox field in the pro version but you can create any custom fields you want https://larazeus.com/docs/bolt/v3/advanced/add-fields no following, you can add an options as a collection then Enable Conditional Visibility
codeartisan
codeartisan4mo ago
so do I install each field type because the example provided is for the icon picker me i want to add a repeater This has been fixed thank you
Lara Zeus
Lara Zeus4mo ago
yes, you can add any field that must depend on a filament component and the filament repeater is already installed php artisan make:zeus-field Filament\\Forms\\Components\\Repeater
codeartisan
codeartisan4mo ago
let continue and let you know I have installed it but it does not appear among the options to choose from
Lara Zeus
Lara Zeus4mo ago
Custom Fields | bolt | Lara Zeus
form builder for your users, with so many use cases. | lara zeus bolt
codeartisan
codeartisan4mo ago
Sorry to ask but how do I flush this bolt key
Lara Zeus
Lara Zeus4mo ago
php artisan cache:clear bolt.fields i think.
codeartisan
codeartisan4mo ago
it returned an error then I only ran php artisan cache:clear but I get the same result How do I customize the header and footer as well?
Lara Zeus
Lara Zeus4mo ago
php artisan cache:clear should worls check if the paths in the config file run php artisan vendor:publish --tag=zeus-views it will publish the views in the view/vendors dir
codeartisan
codeartisan4mo ago
done @Lara Zeus do you mind if we have a simple google meet and you help me out
Lara Zeus
Lara Zeus4mo ago
sorry cant find time currently, I will help you here as much as I can can you share how you plan to use the repeater with a questionnaire form?
codeartisan
codeartisan4mo ago
okay share I see if i can manage how about customizing the header and the footer?
Lara Zeus
Lara Zeus4mo ago
run php artisan vendor:publish --tag=zeus-views it will publish the views in the view/vendors dir and there is an app blade file you can customize it
codeartisan
codeartisan4mo ago
thank you that I have seen Now the repeater I cleared cache but the repeater has refused to appear But so far so good thank you so much sir
Lara Zeus
Lara Zeus4mo ago
I will check more on that later today and let you know
codeartisan
codeartisan4mo ago
thank you I will remind you later
Lara Zeus
Lara Zeus4mo ago
- are you using the Pro version? try to rename the class from Repeater to something else like AppRepeater
codeartisan
codeartisan4mo ago
no I right now am using the free version
<?php

namespace App\Zeus\Fields;

use Filament\Forms\Components\Toggle;
use LaraZeus\Bolt\Fields\FieldsContract;

class AppRepeater extends FieldsContract
{
public string $renderClass = Filament\Forms\Components\Repeater::class;

public int $sort = 20;

public function title(): string
{
return __('Checkbox List');
}

public static function getOptions(): array
{
return [
self::htmlID(),
self::required(),
self::columnSpanFull(),
];
}

public static function getOptionsHidden(): array
{
return [
self::hiddenHtmlID(),
self::hiddenRequired(),
self::hiddenColumnSpanFull(),
];
}
}
<?php

namespace App\Zeus\Fields;

use Filament\Forms\Components\Toggle;
use LaraZeus\Bolt\Fields\FieldsContract;

class AppRepeater extends FieldsContract
{
public string $renderClass = Filament\Forms\Components\Repeater::class;

public int $sort = 20;

public function title(): string
{
return __('Checkbox List');
}

public static function getOptions(): array
{
return [
self::htmlID(),
self::required(),
self::columnSpanFull(),
];
}

public static function getOptionsHidden(): array
{
return [
self::hiddenHtmlID(),
self::hiddenRequired(),
self::hiddenColumnSpanFull(),
];
}
}
changing it automatically causes an error sorry no error but does not appear
Lara Zeus
Lara Zeus4mo ago
it should works, test it in my demo app and the fields dose appears in the fields type menu can you also change the title and check! also the cache will be cleared in the dev environment
codeartisan
codeartisan4mo ago
let me try I change the title to repeater it then appeared and then I created a test repeater but when I run the form after saving it crashes Class "App\Zeus\Fields\Filament\Forms\Components\Repeater" not found
Lara Zeus
Lara Zeus4mo ago
make sure the namespace is correct I think it should be public string $renderClass = \Filament\Forms\Components\Repeater::class;
codeartisan
codeartisan4mo ago
You have saved me alot it works so well thank you sir @Lara Zeus
codeartisan
codeartisan4mo ago
I have one more question how do you think i can achieve this please 🙏
No description
Lara Zeus
Lara Zeus4mo ago
what the plus action will do? add another row? the filament repeater dose support default values but not sure it will looks like that I think you need the key value component
codeartisan
codeartisan4mo ago
The repeater does have text input for me to input something
No description
Lara Zeus
Lara Zeus4mo ago
if its fit your case then use it no problem the zeus fields is tow parts one is for the options on the form builder and it can be any component you want its where the user set the default values and any other options you want to recive it on the render and the other part is how to render it you can check the docs for that there is an example
codeartisan
codeartisan4mo ago
let me check so about the repeater having some issues what do you think?
Lara Zeus
Lara Zeus4mo ago
the repeater is for multiple inputs per row but from your screenshot the key value fit better i think
codeartisan
codeartisan4mo ago
Yeah the repeater is for someone to record many values as they want this was a test form but the repeater works well for our use case its what we were using in raw blade But how comes the input does not appear in the repeater In the normal filament implementation we normally pass in a type Do you think that is the issue?
Lara Zeus
Lara Zeus4mo ago
no. you need to take a look at other fields and how they works for example: vendor/lara-zeus/bolt/src/Fields/Classes/CheckboxList.php add this to your zeus field and customize it as you need
public function appendFilamentComponentsOptions($component, $zeusField, bool $hasVisibility = false)
{
parent::appendFilamentComponentsOptions($component, $zeusField, $hasVisibility);

$component = $component->schema([
//....
]);

return $component;
}
public function appendFilamentComponentsOptions($component, $zeusField, bool $hasVisibility = false)
{
parent::appendFilamentComponentsOptions($component, $zeusField, $hasVisibility);

$component = $component->schema([
//....
]);

return $component;
}
if you want to set the schema from the form builder UI, then you will need to take a look at the getOptions method you will need to have a form builder inside the bolt form builder, I feel it will get tricky!
codeartisan
codeartisan4mo ago
Is this for the repeater sir because am already getting confused
Lara Zeus
Lara Zeus4mo ago
yes 🙂 try the code I posted in the repeater class you will understand more
codeartisan
codeartisan4mo ago
public function appendFilamentComponentsOptions($component, $zeusField, bool $hasVisibility = false)
{
parent::appendFilamentComponentsOptions($component, $zeusField, $hasVisibility);

$component = $component->schema([
TextInput::make('name')->required(),

]);

return $component;
}
public function appendFilamentComponentsOptions($component, $zeusField, bool $hasVisibility = false)
{
parent::appendFilamentComponentsOptions($component, $zeusField, $hasVisibility);

$component = $component->schema([
TextInput::make('name')->required(),

]);

return $component;
}
I added this and it works fine
codeartisan
codeartisan4mo ago
Here I think you didnt understand very well basically this is not for the repeater its totally different just wondering if i can have such a section but not necessarily a table like labels and input
No description
Lara Zeus
Lara Zeus4mo ago
are these an inputs with labels? no repeater or anything?
codeartisan
codeartisan4mo ago
Yeah input with labels the repeater was for a different use case
Lara Zeus
Lara Zeus4mo ago
add a new section and fields
No description
codeartisan
codeartisan4mo ago
That was just a word document
Lara Zeus
Lara Zeus4mo ago
it wont look like a table tho or they are checkboxes for one field
codeartisan
codeartisan4mo ago
someone inputs the values can we achive that format
Lara Zeus
Lara Zeus4mo ago
like this?
No description
Lara Zeus
Lara Zeus4mo ago
I honestly dont get the output you want
Lara Zeus
Lara Zeus4mo ago
or this?
No description
codeartisan
codeartisan4mo ago
Thats it How did you achive that?
Lara Zeus
Lara Zeus4mo ago
yea, ok this is not available RN, but I can add it soon. its just an option to enable ->inlineLabel()
codeartisan
codeartisan4mo ago
so i cannot use it right
Lara Zeus
Lara Zeus4mo ago
not now
codeartisan
codeartisan4mo ago
its fine then thank you
codeartisan
codeartisan4mo ago
I will go with that since the other option is not available
No description
codeartisan
codeartisan4mo ago
But thank you sir hello sir when i check require login the login seems not to work Also how can I make the repeater conditionally render
Lara Zeus
Lara Zeus4mo ago
Zeus Demo
login - Forms - Zeus Demo
- All about Zeus Demo Zeus Demo
No description
Lara Zeus
Lara Zeus4mo ago
dont think this is possible, since the conditionally render require a datasource
codeartisan
codeartisan4mo ago
When I tap login shows login not found
Lara Zeus
Lara Zeus4mo ago
if you have different login routes than the default you will need to publish the views and edit them
codeartisan
codeartisan4mo ago
No description
codeartisan
codeartisan4mo ago
am using the default filament route
Lara Zeus
Lara Zeus4mo ago
what is the url of this page?
codeartisan
codeartisan4mo ago
http://127.0.0.1:8002/login thats the local version but its the same with the hosted version
Lara Zeus
Lara Zeus4mo ago
add Route::redirect('/login', '/admin/login')->name('login'); to your route or publish the views and edit the url this frontend routes is different from app to app so I cant build something for all you will need to customize the views at some point
codeartisan
codeartisan4mo ago
I get you so meaning i can create my own simple login right
Lara Zeus
Lara Zeus4mo ago
yes, you can use the filament one, or laravel breazy, or make your own login page
codeartisan
codeartisan4mo ago
the challenge how will i serve the form
Lara Zeus
Lara Zeus4mo ago
Route::redirect('/login', '/admin/login')->name('login'); this will redirect to the default filament login page you can change admin to your panel url
codeartisan
codeartisan4mo ago
That I have already understand very well I will create a user dashboard and redirect to their dashboard
Lara Zeus
Lara Zeus4mo ago
not following?
codeartisan
codeartisan4mo ago
for the require login I honestly totally get you But after that how will they answer the questionnaire should i just redirect them to the page with the questionnaire
Lara Zeus
Lara Zeus4mo ago
after they log in you would redirect them to the same form and it will be open
codeartisan
codeartisan4mo ago
great stuff thank you sir I will let you know soon working on it
Lara Zeus
Lara Zeus4mo ago
return redirect()->intended(); will help
codeartisan
codeartisan4mo ago
Hello I added the basic breeze so now users are able to register but how do I get the questionnaire route to redirect to
Dennis Koch
Dennis Koch4mo ago
Your thread is 122 messages long, so I won't catch up on it and I'd recommend you to open new threads for new questions. If questionnaire is a page you should be able to run Questionnaire:getUrl()
codeartisan
codeartisan4mo ago
Thats abit more confusing but let me open a new thread
Want results from more Discord servers?
Add your server