Sauravisus
Display all translations
Howdy, is there a way to display all translations used by a model using the Spatie Translatable plugin?
Like, if I have a
name
column, and it gets translated to 4 languages.
How would I go about displaying all 4 languages at the same time, rather than having to edit, save, swap language, edit, save, etc.?6 replies
Adding a save button to EditPage header
So I'm trying to move the save button from the form actions to the header actions, and snatching it out of there with
parent::getFormActions()
and putting that into my header actions does show the button, but the button itself doesn't work, as it's no longer within the form tag.
How would I go about adding a custom action that actually saves the form currently being viewed in an edit page? It's a standard EditRecord page we're talking about here.
This is how I grabbed the buttons from the edit form. The cancel button works fine, but that's just a link so it should. Only the save button isn't working as intended. It's the Arr::first($actions)
one in that list.11 replies
TextColumn vanishes when using dot notation
So I've got this TextColumn component in a table
And if I just name it
website
it shows up but is empty (as my model doesn't have a website field, so that's as expected)
When I name it client.website
, it just disappears as if the column isn't defined at all. It also isn't shown in the column picker. The relationship defined on my model is like this:
This used to work, like 2 days ago, but now it doesn't. I've got no idea why this'd be the case.
Last thing I did that could influence the query for the table is this:
But removing it doesn't return the column at all.10 replies
Toggling editability on fields in a repeater
I've got a repeater with 2 fields in it.
While on the edit view I need the textarea disabled, and the checkbox hidden by default.
Then, I need a button to "unlock" those fields for editing. As in, show the checkbox and un-disable the textarea.
Yes, it sounds wacky, but it's what my client wants I'm afraid. 😅
I tried using
live()
on the toggle, and having both disabled()
and hidden()
use the value from a toggle outside the repeater to try and do what I wanted but that didn't seem to work.20 replies
DefaultSort on a Repeater
I've been searching high and low, but couldn't find an answer to this. Is there a way to decide the sorting order for items in a repeater?
This is my repeater and its components:
I want to sort this by created_at so the newest is at the top; Is there a way I can do this?
14 replies