Disouric
Disouric
FFilament
Created by Disouric on 10/5/2023 in #❓┊help
Select field with modifyQueryUsing doesn't validate client input
Hello, When using a select dropdown with an associated relationship, if I modify the query using its options, the changes are appropriately reflected in the dropdown. However, if I manually input an 'option' ID that isn't present in the scoped query, the system still accepts it. How can I prevent this or is there a workaround? Thank you.
4 replies
FFilament
Created by Disouric on 8/30/2023 in #❓┊help
Issue with Tenancy-enabled test
I am in the process of developing a test that uses a resource situated within a panel, which has tenancy functionality enabled. However, I'm encountering challenges in getting the test to function as expected. Below is the PHP code snippet representing the test:
it('can see own chargers', function () {
$user = User::factory()->create();
$this->actingAs($user);

$team = Team::factory()->create();
$team->users()->attach($user);

$chargers = Charger::factory()->count(10)->create();

livewire(ChargerResource\Pages\ListChargers::class, [
'tenant' => $team,
])->assertCanSeeTableRecords($chargers);
});
it('can see own chargers', function () {
$user = User::factory()->create();
$this->actingAs($user);

$team = Team::factory()->create();
$team->users()->attach($user);

$chargers = Charger::factory()->count(10)->create();

livewire(ChargerResource\Pages\ListChargers::class, [
'tenant' => $team,
])->assertCanSeeTableRecords($chargers);
});
Upon execution, I'm confronted with the following error message:
FAILED Tests\Feature\Filament\App\ChargerResourceTest > it can see own chargers ViewException
Missing required parameter for [Route: filament.app.resources.chargers.view] [URI: app/{tenant}/chargers/{record}/overview] [Missing parameter: tenant].
FAILED Tests\Feature\Filament\App\ChargerResourceTest > it can see own chargers ViewException
Missing required parameter for [Route: filament.app.resources.chargers.view] [URI: app/{tenant}/chargers/{record}/overview] [Missing parameter: tenant].
Any assistance in resolving this issue would be greatly appreciated.
5 replies
FFilament
Created by Disouric on 8/24/2023 in #❓┊help
Tenancy: associate created record with tenant in CreateAction
Hello, How can we efficiently link a tenant to a record when it's being generated via a CreateAction, especially within the relationship manager context? Currently, if someone initiates a new resource item within the relationship manager, this item doesn't get linked with their respective account. Please note, the subsequent code snippet from handleRecordCreation isn't being executed:
if ($tenant = Filament::getTenant()) {
return $this->associateRecordWithTenant($record, $tenant);
}
if ($tenant = Filament::getTenant()) {
return $this->associateRecordWithTenant($record, $tenant);
}
6 replies
FFilament
Created by Disouric on 8/13/2023 in #❓┊help
How to prevent submit with 'Enter' key when using a Wizard?
Title explains it all
3 replies
FFilament
Created by Disouric on 7/27/2023 in #❓┊help
Relation managers in a tab of a Form
The title speaks for itself, is it possible to put a Relation manager in a tab of a Form instead of putting it at the bottom of the page.
5 replies