Damien
How do I make a table column searchable based on its state value?
I have a table column that has a default value of a user_id. However, I format the state to show the users first and last name. Here is the code I have for doing so:
If I search using the user id, it works, however what I would like to be able to do is search by the value of the users name.
Is there a way to do this with my current code or do I need to do something differently?
12 replies
How do I access / create relationships in custom actions that uses the createOptionForm method.
I have a custom action, that enables me to create a resource from another resources view. In this instance, I am wanting to create a project from the view contact page.
Here is the
Step
for my action so far:
Here is the error I am getting when trying to create my project Call to a member function isRelation() on null
Initially I thought I could create a method within the model to satisfy this but I was wrong.
So my question is; how can implement the above so that the isRelation() method is satisfied?7 replies
Is there a way to prevent soft deleted records appearing in global search?
I have checked the documentation for this but I cannot seem to find if this is a configurable option or not.
I would like for records that have been soft deleted, to not be returned by the global search, is this possible?
10 replies
Is it possible to pre-populate this form with some data?
I have a custom widget, with a heading defined like so:
This widget lives on a Company details page, what I would like to do when adding the contact, is to be able to pre-populate some of the information that will come from the company, such as the address.
Is this possible with my current implementation or would I have to change to work?
31 replies
How do I update the view modal state after an edit action?
In the following scenario, I have a
CompanyResource
and I have the following table actions:
At present, when I click a row on the table, it brings up the view modal, I then proceed to click edit, change a value and save. The view modal comes back but it still displays the old name. The table however does update in the background.
What is the best way to handle this so that it gives a better UX than what I am currently giving / getting?
Apologies if this is covered in the docs, I struggled to find it.3 replies
Why does my form `->required()` methods not work inside of a Livewire component?
Hey all, so I am creating a 'Settings' page which has a collection of livewire components.
I am trying to use a Radio input and a File upload input like so:
If I replace these components with say a Text input, it works as expected but the code above, attempts to submit even without data. Now if I copy and paste these into one of my resource forms, the validation works correctly.
Not entirely sure what is going on and happy to provide more code etc.
25 replies
Is there a way to hide a page?
I know you can hide it from the navigation based on authorisation and using this method:
However I don't want to disable it completely, I just don't want to have the link rendered in the navigation and I cannot find in the docs where this might be a possibility.
4 replies
Can I change this edit / view behaviour or is it default?
Just following on from my initial question in https://discord.com/channels/883083792112300104/956270111176679516/1204000267918512200 - here is a little clip showing what is currently happening.
What I prefer to happen, is that the modal just opens in my current view without first navigating to the resources table view.
70 replies
How do I correctly create a link to a record from another view?
I has various pages within the app I am building where I am displaying a list of items based on data being passed in.
what I haven't been able to find in the docs yet though is how I can correctly link to one of the items being rendered so that it either navigates to the record view or opens up the view modal.
Here is some example code with the todo comment being where I would like to action the link from
Apologies if this is an easy find, I struggled to do so and I couldn't find a similar thread in the forumn already.
15 replies
How do you implement create / edit actions correctly within custom widgets?
Hey everyone!
I have been going around in circles a little bit with this and I think I am likely barking up the wrong tree but I have the following class
Creating a room, works as expected, however, I am struggling to get editing a room to work correctly and I feel like I am duplicating code unnecessarily across files. Here are some additional files for context.
I also have this snippet where I have the edit action on each room in a loop.
39 replies
makeModalSubmitAction arguments are empty?
I am trying to use the above method to implment a 'save & create another' action however the arguments are always empty even though I am passing it. I took the the example straight from the documentation, code below:
Not really sure why $arguments is always empty.
7 replies
How do I correctly use a Filament action on a custom widget?
I have built the following widget as part of a project I am working on (pictured) where by I am listing the rooms associated with a quote. Each room, has an edit room button that I am trying to use as the
editAction
and when I click on it, something fires in the network tab but there is no visual change in the UI. I will share some code snippets below for additional context.
The button to call edit:
RoomOverview class where I have defined an edit room action:
editRoomAction
has been created in a similar way to createRoomAction
which is a method I didn't write but works correctly. I have tried passing a $room
param as I figured this may be an issue without it but that does not seem to fix the issue either and causes more problems than it fixes. It could be a lack of livewire experience
Any help is greatly appreciated.7 replies
Extracting form submission data when there are repeaters and relationships
Hey everyone, appreciate it is getting close to Christmas / Holidays for many so I'll try and keep it brief!
I am in a scenario where I have
stock_products
and bom_products
and when creating a bom_product
, I can select multiple stock_products
using a repeater. The data for this is then saved in a bom_stock_products table.
On my BomProduct model, I have a method stockProducts()
which the repeater uses for the relationship and everything seems to be working fine.
What I now need to do, is calculate a cost_price
for the bom_product
and this is based off of the cost_price
for all of the stock_products
multiplied by the quantity.
The issue I am having is that the $data
variable does not contain any information on the stock_products
or their id's so that I can query the stock_products
table.
How would one usually get around this or how can I include the data from the repeater with the relationship to calculate this value.4 replies
Repeater fields are missing on view/edit
I have a repeater field that I add multiple values to but when I then view the record or try to edit it, only the first one in shown.
Here is the code for my repeater:
This is for a simple resource so I don't know if there is something I should be doing to get all of the values I created the record with?
In terms of my database, this Wizard Step is for a group of products and I am looking to add many products. I have a
group products
table, stock products
table and a group stock products
table.
Not entirely sure what is missing at this point of where I should look in the docs.38 replies
What is the best way to save data into multiple tables from one form?
Firstly, I did a search within the other help topics and struggled to find anything so apologies if I missed an example!
For context, I have 2 tables within my database,
projects
and project_addresses
.
When creating a new project, I am using a wizard to capture 3 lots of information project details
, admin details
and address details
the later will be stored in the project_addresses
table and separate from the project details
and admin details
that are stored within the projects
table.
Also I apologise if this is in the documentation, the only thing I found which seemed somewhat related was https://filamentphp.com/docs/3.x/forms/advanced#saving-data-to-relationships but this moves on to talking about loading data which threw me off.35 replies