Bagus A
Bagus A
FFilament
Created by Bagus A on 9/23/2024 in #❓┊help
Render tag inside RichEditor content
No description
1 replies
FFilament
Created by Bagus A on 9/20/2024 in #❓┊help
How to change page number programmatically in a table
No description
15 replies
FFilament
Created by Bagus A on 8/15/2024 in #❓┊help
Change table row background color based on hexadecimal
I would like to show rows on a table where each row will have it's own color from database. The color is defined using hexadecimal, as far as I know FIlament only able to use tailwind color, if it's defined customized from database, is it possible to change the row background color?
1 replies
FFilament
Created by Bagus A on 8/13/2024 in #❓┊help
Go to page X by default on table resource page
I have a table with custom pagination where each page is divided by the number of week of this year. Let's say today is week 50, I want to go to page 50 directly whenever I open the resource table. Is it possible? Thanks in advance
1 replies
FFilament
Created by Bagus A on 7/9/2024 in #❓┊help
How to get filtered table data from widget class?
No description
6 replies
FFilament
Created by Bagus A on 5/31/2024 in #❓┊help
Using formatStateUsing on Select relationship
How can we, for example format a date with the source coming from a relationship? I've tried using formatStateUsing but it doesn't seem to work.
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Select::make('bucket_id')
->relationship(name: 'bucket', titleAttribute: 'date')
->required()
->preload()
]);
}
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Select::make('bucket_id')
->relationship(name: 'bucket', titleAttribute: 'date')
->required()
->preload()
]);
}
7 replies
FFilament
Created by Bagus A on 4/26/2024 in #❓┊help
Customize create label for Resource with ManageRecords
In normal resource with it's own create page, we can have getCreateFormAction method to customize the label of the create button, for example:
protected function getCreateFormAction(): Action
{
return Action::make('create')
->label('Add Customer')
->icon('heroicon-o-user')
->submit('create')
->keyBindings(['mod+s']);
}
protected function getCreateFormAction(): Action
{
return Action::make('create')
->label('Add Customer')
->icon('heroicon-o-user')
->submit('create')
->keyBindings(['mod+s']);
}
This method doesn't work for simple resource which extending ManageRecord without it's own create page. How do we customize the label in simple resource?
1 replies
FFilament
Created by Bagus A on 2/27/2024 in #❓┊help
How to apply default filter/query for a table
I have one table in DB that I would like to display on two resources based on it status. This might be achieved using filters, but filters can be changed and I want a dedicated page for some reason. I only find a way to enable default filter (https://filamentphp.com/docs/2.x/tables/filters#default-filters), but this is not what I'm looking for. How do we apply default filters by code without visible UI?
3 replies
FFilament
Created by Bagus A on 2/26/2024 in #❓┊help
Select Filter with Group By from Column not Relationship
I would like to create a SelectFilter using a column in a table. It's not a relationship so I need to do a query and pluck the name but the options field only accept hardcoded arrays. How do I query the fields inside options method?
4 replies
FFilament
Created by Bagus A on 2/26/2024 in #❓┊help
How to Reuse the Same DB Column in a TextColumn of Table
No description
4 replies
FFilament
Created by Bagus A on 2/25/2024 in #❓┊help
How to combine text and badge?
In displaying as a badge of Text column in Table (using ->badge()) will turn the whole text as a badge. How do we combine a Text column to show a text and a badge: 123 <low> where low is displayed as a badge while 123 as a normal text.
2 replies
FFilament
Created by Bagus A on 2/15/2024 in #❓┊help
How to fullWidth Action in Infolist
No description
4 replies
FFilament
Created by Bagus A on 12/29/2023 in #❓┊help
Show Image in InfoList
In infolist builder, we have an option to show image. My issue is that I don't save the image on the database. I will use an image uploaded to the public folder with filename of the code column. In normal blade, I'm going to render it with
<img height="65"
src="{{ public_path() . '/images/product_images/' . $orderItem->variant->product->code . '.png' }}"
class="" />
<img height="65"
src="{{ public_path() . '/images/product_images/' . $orderItem->variant->product->code . '.png' }}"
class="" />
How do I achieve this in InfoList card?
8 replies
FFilament
Created by Bagus A on 12/6/2023 in #❓┊help
Export Excel from an Action
No description
6 replies
FFilament
Created by Bagus A on 11/30/2023 in #❓┊help
Editable relations in ViewPage with InfoList
So, by default I got EditPage from a Resource allows me to edit it's RelationManager. Because I only need to show static data, I use InfoList and a ViewPage. But, inside this page, I still want to be able to edit the RelationManager (not the Resource owner data). How do I achieve this?
1 replies
FFilament
Created by Bagus A on 11/23/2023 in #❓┊help
How to Use Custom Modal Content
No description
3 replies
FFilament
Created by Bagus A on 11/18/2023 in #❓┊help
Where to rename create button in OrderResource page?
No description
8 replies
FFilament
Created by Bagus A on 11/11/2023 in #❓┊help
How to know what arguments available inside a function?
I'm sure it's not Filament only question, it might closely related to the PHP itself. For example, I would like to pre-process the data before saving it to the database. In this case I need to use before lifecycle hook for a CreateAction. I want to know how I can get the current form data inside this callback. Documentation example show the function without any arguments.
->before(function () {
// Runs before the form fields are saved to the database.
})
->before(function () {
// Runs before the form fields are saved to the database.
})
While, other example show it with two arguments

->before(function (CreateAction $action, Post $record) {}

->before(function (CreateAction $action, Post $record) {}
If I use my text editor to see inside before declaration inside HasLifeCycleHook.php it only has Closure.
public function before(Closure $callback): static
{
$this->before = $callback;

return $this;
}
public function before(Closure $callback): static
{
$this->before = $callback;

return $this;
}
I still don't understand how do I realize that any function in Filament can receive what kind of data? Appreciate every information. Thank you guys.
3 replies
FFilament
Created by Bagus A on 11/8/2023 in #❓┊help
Can I create two modal edit form with different fields?
If I have 4 fields in create form, A B C D. In the table, I would like to have 2 actions, "Edit Information A", "Edit Information B". The first action will only show a modal form with A B fields while the second action only show CD fields. How can I achieve this?
3 replies
FFilament
Created by Bagus A on 11/8/2023 in #❓┊help
Edit Page for RelationManager
I still want to use interactive tables underneath resource forms, but for edit mode, I would like to edit in a page not from a dialog. Is it possible?
2 replies