Lind
Lind
FFilament
Created by Joseph Kerkhof on 9/4/2024 in #❓┊help
Testing a Table ToggleColumn
Best method i've found to toggle the state is:
->call('updateTableColumnState', 'column', $record->id, ! $record->column)
->call('updateTableColumnState', 'column', $record->id, ! $record->column)
Not sure how you can test if its disabled, but you can assert its state with
->assertTableColumnStateSet('column', false, $record->id)
->assertTableColumnStateSet('column', false, $record->id)
4 replies
FFilament
Created by Becker Maxime on 10/23/2023 in #❓┊help
Error configure.php
I believe you need to be on PHP 8.1 for v3
13 replies
FFilament
Created by marco.ferreira on 8/11/2023 in #❓┊help
Problem in the format_money helper
Let's see if Dan or someone else from the team can answer, as i see it you're working against the core principles tho
6 replies
FFilament
Created by marco.ferreira on 8/11/2023 in #❓┊help
Problem in the format_money helper
6 replies
FFilament
Created by Mdk on 8/10/2023 in #❓┊help
Empty CSS when creating a new theme, not extending the default
Ah ok, didn't know that xD
52 replies
FFilament
Created by Mdk on 8/10/2023 in #❓┊help
Empty CSS when creating a new theme, not extending the default
try this postcss.config: ``` module.exports = { plugins: { tailwindcss: {}, autoprefixer: {}, }, }
52 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
What if you implement the small fix i suggested here https://discord.com/channels/883083792112300104/1133478284676562974/1137157678511177838 into the original save function in the PR?
79 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
The solution I just wrote is not the one Dan made a PR for. The PR fixes the swapping between languages. The second one I posted here is to avoid other forms overwriting non-translatables. But I'm gonna look deeper into it tomorrow because the CreateRecord trait seems to be written as intended
79 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
I think we should just look closer at the CreateRecord trait again. I think it works as intended. Went to bed but couldn't stop thinking about it 😅
79 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
I added this code to my save function, that seemed to have fixed it:
public function save(bool $shouldRedirect = true): void
{
$this->authorizeAccess();

$originalActiveLocale = $this->activeLocale;

try {
foreach ($this->getTranslatableLocales() as $locale) {
$this->setActiveLocale($locale);

/* ADDITION start */
$this->data[$locale] = array_merge(
$this->data[$locale] ?? [],
Arr::except($this->data[$originalActiveLocale], app(static::getModel())->getTranslatableAttributes()),
);
/* ADDITION end */

/** @internal Read the DocBlock above the following method. */
$this->validateFormAndUpdateRecordAndCallHooks();
}
} catch (Halt $exception) {
return;
}

$this->setActiveLocale($originalActiveLocale);

/** @internal Read the DocBlock above the following method. */
$this->sendSavedNotificationAndRedirect(shouldRedirect: $shouldRedirect);
}
public function save(bool $shouldRedirect = true): void
{
$this->authorizeAccess();

$originalActiveLocale = $this->activeLocale;

try {
foreach ($this->getTranslatableLocales() as $locale) {
$this->setActiveLocale($locale);

/* ADDITION start */
$this->data[$locale] = array_merge(
$this->data[$locale] ?? [],
Arr::except($this->data[$originalActiveLocale], app(static::getModel())->getTranslatableAttributes()),
);
/* ADDITION end */

/** @internal Read the DocBlock above the following method. */
$this->validateFormAndUpdateRecordAndCallHooks();
}
} catch (Halt $exception) {
return;
}

$this->setActiveLocale($originalActiveLocale);

/** @internal Read the DocBlock above the following method. */
$this->sendSavedNotificationAndRedirect(shouldRedirect: $shouldRedirect);
}
79 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
No errors, i only copied the function into a fresh pull of the repo in the other issue.. Not exactly sure whats the best approach to get the plugin from the monorepo?
79 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
Works on my end
79 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
Yea, my solution copied it out to all languages but copying from old to new is probably quicker incase you have alot of languages and non translateable fields i guess. I did it after the validate in edit, not sure if thats the correct place 🙂
79 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
So after more testing, i figured the solution was in updatedActiveLocale on EditRecord/Translatable and after finding a solution there i went looking at CreateRecord, where theres already implemented a solution. So i guess you could just copy that on to EditRecord
79 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
Yea, and i don't think its implemented in filament anyway. But i was just thinking you could then update the other forms when you swapped language with data from the DB. But i'm not knowledgeable enough on either livewire or filament for it. Already out of my depth here
79 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
Could possible work out something with the updated() function, seems to be able to do real-time saving i LW3
79 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
If i dump the $data in the save() function i can see an array with all the languages as keys and the data from their forms, changing a non-translatable field in 1 form doesn't change it in all forms. I don't know if this is the right bevaviour, but its what i've seen in my own code and when i run the repo linked earlier. The issue with the fix niels provides assumes you're still on the language you changed the non-translatable field when you hit save. If you're not, it'll still override it with what was in the last form.
79 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
I'm also struggling with this and i think the root cause is each language is its own form? So if you don't change the non-translatable field in the last language that is what is gonna stick in the database? I'm working on disabling all non translatable attributes on all languages but the default one and then override the other forms with the data from the default language form. But thats alot of checks xD
79 replies
FFilament
Created by toeknee on 6/15/2023 in #❓┊help
Sub title?
You can do it with either $subheading variable or getSubHeading() function on a page
5 replies
FFilament
Created by Prodex on 6/13/2023 in #❓┊help
Save MM relationship with single select
I'm not that familiar with this use case sadly, where i use it i have $state available. Hopefully someone with better understanding of it can help 🙂
27 replies