torriv
showing headerActions based on what tab you are on
I'm trying to show a header action only if you are not on the 'all' tab. when i output $livewire->activeTab in ray(), it updates correctly.
so i figured out this behaviour:
1. if i go to the page and try different tabs, nothing happens.
2. if i click on a tab that is not 'all', and then refresh the page, then it works as expected when i click back and forth on different tabs.
anyone knows why and how to fix it?
3 replies
Add styles to tailwind
I've come across an scenario where i need to use this from tailwind:
bg-red-600, bg-cyan-600 and bg-green-500,
i have read the docs, but not sure if i understand what needs to be done to be able to use these...
they are going to be used in a custom view.
47 replies
Possible to extract common fields?
Just wondering if i'm doing it right, or if there is a way to optimize it somehow. I feel it's a lot of repeating. any suggestions are welcome.
i have a form where i put each day in a week in a tab. so the tabs are named 'Monday', 'Tuesday' and so on.
Under each of these tabs, i'm adding data for that day.
This code is the same for each day, except the tab name, badge, repeater make() and relationship query.
Would it be possible to extract the common parts of this somehow? hope you understand what i'm asking for.
6 replies
Adding livewire component to custom page
I have a custom page where i'm showing a table. The table is in different livewire components. for example the header is in one components and the rows are in another component.
it's working fine locally. But as soon as i deploy it, i get
in my page i have this code:
i also tried with this:
Does anyone have any clue where i can start debugging this? i've been trying for a long time now.
11 replies
Undefined array key "recordId"
I read this thread:
https://discord.com/channels/883083792112300104/1108254033795362896
but couldn't find a solution for my problem, even if it's the same error.
The error is appearing when i try to save.
my headerActions code is:
where have i messed up?
4 replies
Showing pivot data in infolist
i'm trying to show some data from a pivot table in my infolist.
The infolist is like this:
The 'exercise_name' is showing, but that is from the parent table. but the rest is in the pivot table. i've tried to add the name of the pivot table, but that didn't work either. (like 'nameOfPivotTable.repetitions')
7 replies
Full screen widget
Is it possible to toggle a widget (chart widget to be specific) to show in full screen? I haven't found anything about it.
I was first thinking of adding an action in the header of the widget, but that doesn't seem to be possible without making a custom widget. am i right?
11 replies
getTableRecordKey(): Return value must be of type string, null
I suddenly get this error:
Filament\Resources\Pages\ListRecords::getTableRecordKey(): Return value must be of type string, null returned
In V2 I used to solve it by having this:
This doesn't seem to work anymore. this error came today after updating to the latest version.
the table query:
17 replies
Forms Reactivity, hidden conditions
I have tried for a couple of days now to make a form to register some times. The and are hidden or shown if the user has checked the "all day" checkbox or not.
The problem is that i then have to have one field with the and one field with the with the same field name.
I didn't manage to make that work, so what i did is making those fields with different names, and add some hidden fields with the actual field names that are used in the DB and pug $set in those fake name fields in the afterStateUpdated.
I managed to make it work on the create process.
The problem now is on the edit page. since my fields have fake names in the schema, it won't pick the data from the DB.
Do anyone have a suggestion how to solve this?
Here is the stripped version of the code:
https://gist.github.com/torriv83/e9bfd0bd4a219e0e1f2f5cf656f78d5a
29 replies
Route not defined , custom page
Trying to access a custom page through userMenuItems, but i get the error
Here is my AdminPanelProvider.php code:
It worked on V2. I have cleared all cache. if i remove menu item and just have a link to the page in the regular navigation, it works.
Anyone have any suggestions?
5 replies
Get information from DB after selcting one option
I'm trying to make myself a place to record all my tests results (from a sport).
Let's say i've just finished a strength test.
Scenario:
I have one table with what kind of tests i do. (for example: Bench press, pull down etc).
and one table to register my results
The db structure is:
table name: tests
- id
- name
- exercises (json, populate through repeater field. properties in this json is: Name and Type)
table name: test-results
- id
- date
- test
I'm not sure how to set up the test-result table, but what i'm trying to do now is to choose the kind of test i'm taking, and then put in the results from my test where it gets data i need to record from the table tests.
i'm not sure if i'm clear enough, just ask and i'll try to answer.
3 replies