biebthesecond
biebthesecond
FFilament
Created by biebthesecond on 10/17/2024 in #❓┊help
$get() not finding fields
No description
7 replies
FFilament
Created by biebthesecond on 10/9/2024 in #❓┊help
disableOptionsWhenSelectedInSiblingRepeaterItems fails with multi-select
I have a repeater with a multi-select field, I don't want the same answers to be inputted in different repeater rows. But the method ->disableOptionsWhenSelectedInSiblingRepeaterItems() doesn't seem to work with multi-select. If I remove ->multiple() it works as it should. Am I doing something wrong? Repeater::make('second.questions') ->hiddenLabel() ->minItems(1) ->reorderable(false) ->schema([ TextInput::make('question') ->label(('Question')), Select::make('answers') ->label(('Followup from answer(s)')) ->options(function (Get $get) { return $this-> flattenAnswerArray($get('../../../first.answers'), true); }) //->searchable() ->multiple() ->disableOptionsWhenSelectedInSiblingRepeaterItems() /->native(false), ]),
2 replies
FFilament
Created by biebthesecond on 10/8/2024 in #❓┊help
disableOptionsWhenSelectedInSiblingRepeaterItems fails with multi-select
No description
2 replies
FFilament
Created by biebthesecond on 9/20/2024 in #❓┊help
Dynamic wizard checkboxlist selects all
Good afternoon, on a custom livewire page I have a wizard which the user gets to right after registering their website to us. In the wizard they can configure some things, the second step of the option gives the user a choice between two radio buttons. Dependent on the choice they get a dynamic third step, on of those results is a checkboxlist. But when I click anything they either all select or deselect. I saw some other posts, but I felt like those didn't really apply to this scenario. It's probably a skill issue, but I feel kinda stuck. I hope anyone can help me with this I saw in another post that this worked, but I already have it:
$this->form->fill() in mount()
$this->form->fill() in mount()
I have a feeling its because of the $get() which makes the wizard step dynamic, but that also doesn't make sense I think? Next to that I've tried removing the match, no results.
Wizard\Step::make('Products')
->schema(function (Get $get) {
return match ($get('flowType')) {
'product' => [],
'service' => [ CheckboxList::make('flowInterests')
->label('What data are you interested in from a user')
->required()
->bulkToggleable()
->options([
'name' => 'Name',
'email' => 'Email',
'address' => 'Address',
'company' => 'Company',
'phone' => 'Phone number',
])
};
}),
Wizard\Step::make('Products')
->schema(function (Get $get) {
return match ($get('flowType')) {
'product' => [],
'service' => [ CheckboxList::make('flowInterests')
->label('What data are you interested in from a user')
->required()
->bulkToggleable()
->options([
'name' => 'Name',
'email' => 'Email',
'address' => 'Address',
'company' => 'Company',
'phone' => 'Phone number',
])
};
}),
3 replies
FFilament
Created by biebthesecond on 5/14/2024 in #❓┊help
Repeater inline delete action
No description
6 replies
FFilament
Created by biebthesecond on 10/16/2023 in #❓┊help
Fileupload Maxsize not working?
Today I was testing some file uploads with max file sizes, and of course the server responded with a "413(Payload Too Large)". So I implemented a 12mb max upload size ->maxSize(12288). But when I tested it a again it seemed as if the validation didn't even happen, the fileuploader got stuck again and the server returned the same 413 error. I've also tried to add ->live() which didnt work. I've tried to updating the max upload size in the livewire config, didn't work either. Furthermore I have the maxuploadsize defined as php.ini is 100m I have a feeling it might have something to do I'm handling the upload in the ->afterStateUpdated(function (?Model $record) { //code }). But even then I would just expect it to show a error to the user that the max filesize is X amount. Is it a bug that the validation is not working or am I missing something?
14 replies
FFilament
Created by biebthesecond on 10/6/2023 in #❓┊help
Table row action not working
Good morning, I have a filament table on a custom livewire page in which I want to put a row action. So I did just that according to the documentation. But when I click the action in the table it shows a short loading icon and then does nothing. What does work is if I put ->url('someurl')->openUrlInNewTab(). So it definitely triggers the action, but it doesn't reach the ->action() method for some reason. I have a feeling it might have to do with that the results are based on a query and not a model. But I'm not sure. So any help would be appreciated. The table query:
public function table(Table $table): Table
{
return $table
->query(
$this->team->members()->getQuery()
)
public function table(Table $table): Table
{
return $table
->query(
$this->team->members()->getQuery()
)
The action:
->actions([ \Filament\Tables\Actions\Action::make('DissociateTeamMember')
->requiresConfirmation()
->hidden(!$this->isTeamAdmin)
->color('danger')
->icon('heroicon-o-x-mark')
->label('Teamlid verwijderen')
->action(function () {
dd('test');
}),
])
->actions([ \Filament\Tables\Actions\Action::make('DissociateTeamMember')
->requiresConfirmation()
->hidden(!$this->isTeamAdmin)
->color('danger')
->icon('heroicon-o-x-mark')
->label('Teamlid verwijderen')
->action(function () {
dd('test');
}),
])
5 replies
FFilament
Created by biebthesecond on 9/15/2023 in #❓┊help
multi-select with relationship not returning data
No description
21 replies
FFilament
Created by biebthesecond on 8/3/2023 in #❓┊help
Transfer data from form to Action Form
Hey Everyone, On my website there's a file input that on change has to activate a modal action with additional fields. In that action there's also a file input field. I want to be able to transfer the inputted files in the form to the ones in the action. I have of course tried the fillForm() method, but that function seems to run on loading the page and not on calling the action, so the data to transfer doesn't exist yet. There's probably a event to be called, but I haven't been able to figure it out yet and the documentation doesn't tell to much about this. The file input in fillForm() expects data be like this: [ '<possible_directory>/<filename>.<format>', ]. The data you get from the form is exactly that. So that should work. I hope someone can help with this.
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\FileUpload::make('files')
->multiple()->reactive()->directory(Auth::id())
->preserveFilenames()
->afterStateUpdated(function () {
$this->mountAction('sendMessage');
})
->label(''),
])
->statePath('data');
}
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\FileUpload::make('files')
->multiple()->reactive()->directory(Auth::id())
->preserveFilenames()
->afterStateUpdated(function () {
$this->mountAction('sendMessage');
})
->label(''),
])
->statePath('data');
}
public function sendMessageAction(): Action
{
return Action::make('sendMessage')
->label('Verstuur bericht')
->fillForm(['files' => $this->form->getState()['files']])
->form([
Forms\Components\TextInput::make('subject')
->label('Naam document')
->required(),
Forms\Components\FileUpload::make('files')
->multiple()
->previewable()
->preserveFilenames()
->directory('livewire-tmp')
->label('Bestanden')
])
->action(function (array $data) {
app(SaveSentMessage::class)($data);
});
}
public function sendMessageAction(): Action
{
return Action::make('sendMessage')
->label('Verstuur bericht')
->fillForm(['files' => $this->form->getState()['files']])
->form([
Forms\Components\TextInput::make('subject')
->label('Naam document')
->required(),
Forms\Components\FileUpload::make('files')
->multiple()
->previewable()
->preserveFilenames()
->directory('livewire-tmp')
->label('Bestanden')
])
->action(function (array $data) {
app(SaveSentMessage::class)($data);
});
}
1 replies