Pablo Torres
Replicate action do not exclude passed attributes.
I need to replicate records from model 'LegacyClient' to model 'Client'.
In the 'clients' table I do not need some attributes from 'legacy_clients'. Implementing '->excludeAttributes' does not work.
I get:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sector' in 'field list'.
Any advice...? thanks.
2 replies
Send data from edit page to create page on a different resource.
Im using Laravel v10 and Filament PHP v3
I have the following models:
Client
LegacyClient
I want to allow users to re-use the legacy client data to create a new client record.
For this I want to create a form action that 'sends' the data from the form in EditLegacyClient.php page to the form in CreateClient.php page.
On my EditLegacyClient.php page I have:
Can someone please help me on how can I send the data across from the form in EditLegacyClient.php page to the form in CreateClient.php page?
Thanks...
1 replies
Custom text columns, calculated values, sum of related table values.
Hi,
I have:
Model: Booking
Model: Deal
My booking view shows this table (part of it).
I have some questions, please read the comments.
Please, any advice is much appreciated,
Thank you,
Pablo
2 replies
Summary to calculate VAT if not exempt.
Please, I have the following code in my DealsRelationManager.php in my Bookings edit page.
I need to update the code so the hard-coded id '2'
In line: $booking = Booking::where('id', 2)->firstOrFail();
is dynamically loaded. Any suggestions, thanks."
4 replies
In a table display custom text when column is null. Works on v2 but not on v3.
This works on v2 but not on v3, any suggestions, please?
On Filament v2
When the column 'marked_ready_at' does not yet have a date (is null) it shows 'Not yet'. Otherwise, it shows the date in a human-friendly way.
On Filament v3
It doesn't work.
Model
Filament resource
Does anyone have the update or perhaps a better approach to achieve it?
PHP v8.2
Thank you.
4 replies
Browser does not refresh on file save (Docker)
Please, anyone using Docker (macOS) my browser is not refreshing automatically. I have done the following:
File: vite.config.js
File: tailwind.config.js
I'm using:
Laravel v10
Filament v3 (new project/fresh install)
Docker
macOS
Safari
I do run: 'sail npm run dev', when saving a file (Filament file eg. app/Filament/Resources/UserResource.php) on the terminal I get:
Unfortunately, my browser does not auto-refresh.
Any ideas, thank you.
Pablo
3 replies
Tooltip available only if return has value.
On my table, I have this code to show a tooltip.
If the record has been marked READY the tooltip shows, eg:
Marked READY at: 2023-08-01 15:34:00
But if the record has not yet been marked as READY (null), the tooltip shows:
Marked READY at:
I would like to have the tooltip available only when there is a date/time to show up.
Is there anything to show the tooltip only when the return data is not null?
Thank you.
5 replies
Conditionally hide action button.
I have created an Action.
Everything is working fine with the code below. When the action button is used the modal appears, and after confirming 'marked_ready_at' gets the current date/time.
I want to hide or disable the action button "Mark Ready" when "marked_ready_at" has a date/time.
Any suggestion on how I can achieve this?
Thanks.
6 replies
Customizing data before saving
On my BD I have:
On my form, I have:
In my model, I have:
I want when the toggle is used the 'marked_ready_at' to automatically grab the current date/time.
I have tried the following:
On my Pages/Edit
What I/m doing wrong?
Is there a better approach?
Thanks.
9 replies
DateTimePicker: Error - Invalid datetime format
Hi,
I have column "payment_due_at" , $table->dateTime('payment_due_at')->nullable();
My form:
When submitting I get:
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '1690542420' for column 'payment_due_at' at row 1
I have also tried:
Same error
Any suggestions, please?
Thank you
5 replies
Cents on DB how to show in money?
I have a column "price" datatype INT
I'm storing my prices in cents, eg: 1658460
My form looks like this:
How can I have my form show £16,584.60 and not £1,658,460.00, somewhere I need to divide the price by 100, where/how?
Thanks.
3 replies
Price - show as money but store in cents
I have a column "price" datatype INT
I want to store the price in cents
My form looks like, I'm implementing the money() method:
My table
When saving eg:
£16,584.60
On the DB gets stored 16585 instead of 1658460
How can I have my form show £16,584.60 but when saving store in cents?
Thanks.
6 replies
Form, Grid to have Sections on main area with side area.
I have a form a want to display in like a main area with a side area.
Like this sample:
https://demo.filamentphp.com/shop/products/1/edit?activeRelationManager=0
I have the following code, what I'm doing wrong...?
The above code gives me the sections stacked and not "Name" on the left (2 columns) and "Date" on the right (in one column).
Thank you for your help.
3 replies