Wim
Don't show Actions for Database notifications that are marked as read
I have the following database notification:
This successfully shows a button on each notification. How can I NOT show the button when the notification is read (e.g. in the notifications table there is a read_at that is not null in such case)
I tried it as follows but that does not work:
Any idea's?
3 replies
Favorite products: many to many not working
I have an app where users can favor many products. This is done via a many to many relation with a Favorite pivot table. Adding things into the database works.
The
favorites
table is as follows:
In Filament I have a Favorites resources where the idea is the user can get an overview of the products he's favoured. In a Filament table I have the following:
The username is printed but the product name is not. Any idea how to do this? I keep on struggling with this.
Some more information in case relevant:
User Model:
Product model:
Favorite model:
4 replies
Spark's current subscription plan in Filament Form
I'm integrating Laravel Spark with Filament. I would like to show the user's current subscription in a Form (on the Profile page)
I can get the subscription as follows:
Obviously this does not work. Any idea how I can show the current user's subscription
For info, here's the relevant database section:
1 replies
Filament with Spark integration
I'm currently integrating Filament v3 with Laravel Spark for a multi-tenant application.
In the AppPanelProvider.php I have added
->requiresTenantSubscription()
, the document states that users will be redirected to the billing page if they don't have an active subscription.
My issue is that I'm always being redirected to the billing portal. I do have a subscription for the organization (which is the tenant). I get a 'Your subscription has been started successfully.', as well as a way to 'change the subscription plan' as well as entries in the database subscription table.
The expected behaviour would be that in this case (with a subscription) it would simply allow me to go the the Filament backend of my application.
Any ideas?3 replies
Multi-tenancy: don't show tenancy menu when individual user
I have setup multi-tenancy according to the information here.
I know I can use tenantMenu(false) as I did below.
However, I want to do this only when a user is an individual. In my database I have a table organizations that has a column
is_individual
. How can I change is to that only organizations see the menu whereas individual users don't get to see it.
Or would I need two panels: one for individuals and one for organizations?2 replies
Filament resource for Markable
I'm using this package. It works well however I would like to show the favorites in Filament backend. I have a model
Product
. A user can mark a Product as favorite, which results in entries in the table favorites
as follows:
I have the following model:
Ideally I have a resource called FavoriteResource
which allows me to show all favorite products for that user.
Any idea how this can be done, given I did not create the model Favorites
(but rather using the markable package).1 replies
Layout messed up when returning from Filament login page
I have an issue when I go to the Filament login page and then go back (via browser) to the original page. The layout of the original page gets messed up, a refresh of the page helps.
You can see it here.
Steps to reproduce:
1) Go to the page, you will see overview of animals
2) Click on Login
3) Use back button on browser. You will see the same page but with another layout
4) Click refresh in browser (it will 'restore' the original layout')
Any idea why this is?
5 replies
Different sections on Create and Edit form
I have a form with a grid and 4 sections as follows:
As it is now all 4 sections are displayed on the create and the edit page. I would want to change it so that section
publish_info
is only shown on the edit page.4 replies
formatStateUsing with condition
I have a table with users. Some users are individuals, others are organizations (db field 'organization' is either true or false). For the organizations I have a field 'organization_name' which is null for individuals.
I want to display a table with users. For the organization name is have the following:
The idea is to display
NA
in the table where the organization_name is null. However it does only display the organization_name (when filled in in the database) but it does not display the NA
when not filled in in the database4 replies
Filament table enum: enum does not exist
I have a database table where a column 'organization' can be 0 or 1 (non-organization or organization). The column type is
tinyint(1)
. I was using the following code with an enum() function
But I'm getting Method Filament\Tables\Columns\TextColumn::enum does not exist.
error.
Any ideas?2 replies
Custom table action to show blade file
In a Filament table, next to the view/edit/delete action I have defined a custom action (publish). For this, I'm using the following
This shows a modal form and all works well.
I know I could use an InfoList so that one clicks on a view that the Infolist is displayed. But I would like this to happen when a user clicks on a custom action (instead of the view button).
Is this possible?
1 replies
Display two sections next to each other
I would like to have a Filament Form where I have two sections next to each other.
I was looking into the documentation but it seems not to be possible. Grid columns does seem to create two columns but inside a section. I don't want that, I want two independent sections next to each other
I have been trying the following:
and
Both don't work.
6 replies
Conditionally display Form TextInput
I have the following text input:
It can be that there is no voucher code and then I prefer not to show the Text Input. If there is a voucher code, I want to show the Text Input.
Note: not sure if relevant but I'm using this inside the action method of a table.
How can this be achieved?
4 replies