javalava6985
Custom filter count is zero
I have made a custom DateFilter:
It extends the SelectFilter:
In the setUp method i have used $this->indiscateUsing(). This displays the indicators but it does not update the filter count. I can see in the docs that i need to use the ->indicateUsing for the count to update but how do i make it work with a custom filter?
2 replies
Testting anonymous actions
I have an infolist (ViewProject.php) for my ProjectResource. This just displays a number of sections and groups. Of of those sections contains a number of anonymous actions, like:
The action itself works just fine, i just have no idea how to reach this action in a (pest) test. Can someone point me in the right direction or tell me how i can refactor if i need to rewrite my actions.
3 replies
Costumize AttachAction
I have a relation manager in a Laravel Filament V3 app. It manages the relation between my Project model and my Attendee model. They are connected through a pivot table and a BelongsToMany relationship.
When i add the AttachAction in the header i want to be able to search my projects by name but the name is not on the Project model itself. The name is set on a Course model which is connected trough a HasMany / BelongsTo relationship.
I've tried to do this. The TextColumn gives the title of the course but the AttachAction does not work: Unknown column 'course.title' in 'where clause'
2 replies
Advice on user roles
I'm looking for a bit of advice on how to construct my app. I'm starting a new project with laravel filament v3. I have a couple of different user roles but the main are 3 different roles. We have 2 different companies that are seperated from one another but operate in a similar fashion. I have an admin role that should see all the clients, meetings etc. for bith companies. the other 2 roles are from the 2 different companies and they should only be able to see the clients, meetings etc. for their own compay. How would you construct this app?
- Option 1: 1 admin panel with multiple user roles;
- Option 2: A different panel for each role
- Option 3: Implement the multi-tenancy options from filament v3.
1 replies
Set the state of ->afterStateUpdated inside a test
My page shows some text after the user selects a certain entry form a Select::make(). I use the ->afterStateUpdated method to change the text if a certain condition is met. Does anyone know how i can implement this inside a (Pest) test?
The following doesn't work:
$livewire = livewire(CreateReport::class)
->set('client_id', $newReport->client->getKey())
->call('afterStateUpdated', 'client_id'); // Call the afterStateUpdated method if needed
I'm in V3.
1 replies
Testing with Pest keeps giving a 403 response
I'm trying to test my filament (V3) app with pest. I've added the actingAs rule in the setup for TestCase.php as per the documentation. However, when i try to test my ClientResource with the code:
it('can render page', function () {
$this->get(ClientResource::getUrl('index'))->assertSuccessful();
});
I keep getting a 403 on running the test. Any idea what i'm doing wrong?
1 replies