Grégoire
Grégoire
FFilament
Created by Jomatom on 11/2/2024 in #❓┊help
Store order (in session?) in custom Repeater
Thanks for sharing your solution, I was looking for something similar and wanted to say that posting solutions is helpful!
8 replies
FFilament
Created by giuszeppe on 7/11/2024 in #❓┊help
ImageColumn not setting src attributes
I had this problem once and it was actually due to the disc not being set to public when uploading. Might be worth checking where that image is, which disc is used in the env file, etc.
4 replies
FFilament
Created by Nima on 9/18/2024 in #❓┊help
Custom grid structure in filament
Why not just use the Grid component? https://filamentphp.com/docs/3.x/forms/layout/grid
20 replies
FFilament
Created by Grégoire on 8/12/2024 in #❓┊help
Looping through multiple Livewire components containing Filament Action crashes Firefox/Safari
Nice solution @Hugo Myb. I have reverted back to Wire Elements so I am not using your fix for the moment, but I will definitely keep it in mind!
11 replies
FFilament
Created by Grégoire on 8/12/2024 in #❓┊help
Looping through multiple Livewire components containing Filament Action crashes Firefox/Safari
There are some discussions on #7746, but it has been going on for a while.
11 replies
FFilament
Created by Grégoire on 8/12/2024 in #❓┊help
Looping through multiple Livewire components containing Filament Action crashes Firefox/Safari
Same on my end. I failed to find a solution and went back to dynamic modals with wire elements and setting up a form with inside a classic Livewire component. Not great because that means maintaining two logics at the same time.
11 replies
FFilament
Created by Grégoire on 8/11/2024 in #❓┊help
Handling dispatch events with named parameters in Filament Action
Never mind! After changing the file several times, I forgot to put back implements HasActions, HasForms, which caused the problem. Thanks for your time both of you! ❤️
9 replies
FFilament
Created by Grégoire on 8/12/2024 in #❓┊help
Looping through multiple Livewire components containing Filament Action crashes Firefox/Safari
One workaround I've found is to move the logic to the parent component instead of keeping it within the lazy-loaded dropdown content. Then, you can trigger the Filament action with wire:click="$parent.mountAction('test')". This approach ensures the action is only loaded once rather than multiple times. I tested it, and it works well. However, what I don't like about this solution is that the logic is now separated from the dropdown content. This means that every time I use the dropdown, I have to remember to include the action logic in the parent component (hopping there is one). Additionally, if I want to use the dropdown as a standalone component (on a page with just one option), it won't function properly.
11 replies
FFilament
Created by Alnuaimi on 8/11/2024 in #❓┊help
How to add mentions on the Filament RichEditor field?
Take a look at this minimal example using Alpine.JS: https://stackblitz.com/edit/vitejs-vite-lsgy44?file=src%2Fsuggestions.js
5 replies
FFilament
Created by Grégoire on 8/11/2024 in #❓┊help
Handling dispatch events with named parameters in Filament Action
Yes, of course! The trace is attached. I also took the time to create a minimal repo. Just go to /test to reproduce it. Let me know if I can do anything to assist.
9 replies
FFilament
Created by Grégoire on 8/11/2024 in #❓┊help
Handling dispatch events with named parameters in Filament Action
To be honest, I am slowly moving away from wire elements to filament elements, but I have to work with a bit of both at the moment.
9 replies
FFilament
Created by Grégoire on 8/11/2024 in #❓┊help
Handling dispatch events with named parameters in Filament Action
That's a great idea! And thanks for all your work with Filament. Quick question, how would you deal with component injection inside a Livewire component? According to the documentation I just need to pass Component $livewire. I end up with something like:
Filament\Forms\ComponentContainer::make(): Argument #1 ($livewire) must be of type Filament\Forms\Contracts\HasForms, App\Livewire\Header\Dropdown\SwitchTeam given
Am I missing something here?
class JoinTeamAction extends Action
{
protected function setUp(): void
{
parent::setUp();

$this->action(fn(Component $livewire) => $livewire->dispatch('slide-over.open', component: 'settings.team.switch-team-slide-over'));
}
}

// ...

class SwitchTeam extends Component
{
use InteractsWithActions;
use InteractsWithForms;

public function joinTeam(): Action
{
return JoinTeamAction::make();
}
}
class JoinTeamAction extends Action
{
protected function setUp(): void
{
parent::setUp();

$this->action(fn(Component $livewire) => $livewire->dispatch('slide-over.open', component: 'settings.team.switch-team-slide-over'));
}
}

// ...

class SwitchTeam extends Component
{
use InteractsWithActions;
use InteractsWithForms;

public function joinTeam(): Action
{
return JoinTeamAction::make();
}
}
9 replies
FFilament
Created by Alnuaimi on 8/11/2024 in #❓┊help
How to add mentions on the Filament RichEditor field?
If you're using Adam Weston's great TipTap plugin, you can install the "mention" extension. Then you just need to parse the input and notify the person using your existing logic.
5 replies
FFilament
Created by Grégoire on 7/22/2024 in #❓┊help
Issues with dynamic checkboxlist state in multi-step wizard form
Thank you for taking the time to investigate, I have sent you a small donation 🙂
22 replies
FFilament
Created by Grégoire on 7/22/2024 in #❓┊help
Issues with dynamic checkboxlist state in multi-step wizard form
That's exactly what I will do, loop through the enum, generate empty checkboxlists and then update them when needed.
22 replies
FFilament
Created by Grégoire on 7/22/2024 in #❓┊help
Issues with dynamic checkboxlist state in multi-step wizard form
Not that many, in the project I have up to 14, all stored in an enum.
22 replies
FFilament
Created by Grégoire on 7/22/2024 in #❓┊help
Issues with dynamic checkboxlist state in multi-step wizard form
Yes, it is definitely the getter, I have identified that earlier, but I will still need it. However, what you said about all elements needing to be initiated first is exactly what I missed in my investigation.
22 replies
FFilament
Created by Grégoire on 7/22/2024 in #❓┊help
Issues with dynamic checkboxlist state in multi-step wizard form
Oh, I put it in Settings in the admin panel. Maybe that was not the most logical place to put it. If I can help you investigate in any way, please do not hesitate. In the meantime, I've found a workaround for the project by creating all possible checkbox lists, dynamically hiding the ones I don't need, and updating the chexboxes instead. It is not great because it is heavy and calls the database once for each category (instead of just once).
22 replies
FFilament
Created by Grégoire on 7/22/2024 in #❓┊help
Issues with dynamic checkboxlist state in multi-step wizard form
Hi again 👋 I've tried just about everything I can think of, and I'd just like to check with you whether this is a skill issue (which it probably is), or a proper, non-expected behaviour of filament. I have created a minimal repository after seeding the database (email: [email protected] ; password: password), which you can find here: https://github.com/CeriseGoutPelican/filament-issue
22 replies
FFilament
Created by Grégoire on 7/22/2024 in #❓┊help
Issues with dynamic checkboxlist state in multi-step wizard form
Thank you for your answer! Actually, I am pretty sure that my values are good. I think the problem is more likely that the documents are empty at first and then generated a second time. The following example generates visually exactly the same thing, but in the first case it works as expected and in the second case all states of a single CheckboxList are linked.
// This is working:
->schema(function (Get $get) {
$documents = Document::query()
->where('user_id', $get('user_id'))
->get()
->groupBy('user_id');

for ($i = 0; $i < 10; $i++) {
$fieldsets[] = CheckboxList::make('documents-' . $i)
->options([
'tailwind' => 'Tailwind CSS',
'alpine' => 'Alpine.js',
'laravel' => 'Laravel',
'livewire' => 'Laravel Livewire',
]);
}
return $fieldsets;
});

// This is not working:
->schema(function (Get $get) {
$documents = Document::query()
->where('user_id', $get('user_id'))
->get()
->groupBy('user_id');

$i = 0;
foreach ($documents as $document) {
$fieldsets[] = CheckboxList::make('documents-' . $i)
->options([
'tailwind' => 'Tailwind CSS',
'alpine' => 'Alpine.js',
'laravel' => 'Laravel',
'livewire' => 'Laravel Livewire',
]);
$i++;
}
return $fieldsets ?? [];
});
// This is working:
->schema(function (Get $get) {
$documents = Document::query()
->where('user_id', $get('user_id'))
->get()
->groupBy('user_id');

for ($i = 0; $i < 10; $i++) {
$fieldsets[] = CheckboxList::make('documents-' . $i)
->options([
'tailwind' => 'Tailwind CSS',
'alpine' => 'Alpine.js',
'laravel' => 'Laravel',
'livewire' => 'Laravel Livewire',
]);
}
return $fieldsets;
});

// This is not working:
->schema(function (Get $get) {
$documents = Document::query()
->where('user_id', $get('user_id'))
->get()
->groupBy('user_id');

$i = 0;
foreach ($documents as $document) {
$fieldsets[] = CheckboxList::make('documents-' . $i)
->options([
'tailwind' => 'Tailwind CSS',
'alpine' => 'Alpine.js',
'laravel' => 'Laravel',
'livewire' => 'Laravel Livewire',
]);
$i++;
}
return $fieldsets ?? [];
});
22 replies