Daniel
Issue: Reactive Field Visibility Not Working as Expected in ProductPriceResource
I'm having trouble with a reactive form field in ProductPriceResource. A 'Recurring Billing Period' field should show/hide based on a 'Price Type' ToggleButtons selection:
Problem: The 'Recurring Billing Period' field doesn't appear immediately when 'Recurring' is selected. It only shows up after saving the form.
What I've Tried:
- Adding
->reactive()
to Section and Form
- Using afterStateUpdated
on 'price_type'
- Debug logging
This works in other resources (e.g., CourseResource) but not here. Any ideas on what might be causing this and how to fix it?2 replies
Issue: MorphToSelect with Translated Titles
I'm struggling to set up a MorphToSelect field for a polymorphic relationship where I need to display translated titles.
Here's my current setup:
Courses have translations in a separate table.
I can't get the translated title to display in the select field - I either get errors about undefined columns or the ID is displayed instead of the title.
How can I properly set this up to:
- Display the course title in the primary language.
- Allow searching based on translated titles.
- Correctly save the polymorphic relationship.
Any help is appreciated!
1 replies
Use Tailwind classes in Custom Pages
Hello guys,
I'm having an issue with Tailwind styles not working in custom pages of Filament. Here's the situation:
1. I've created a custom page in Filament with
php artisan make:filament-page
.
2. I'm trying to use Tailwind classes like bg-blue-500
and text-white
in this page.
3. These Tailwind classes are working fine in my user-frontend, where I am using them with Svelte.
4. However, in my Filament custom page, the styles aren't being applied at all.
I've double-checked my tailwind.config.js
and it includes my custom views.
```js
module.exports = {
content: [
'./resources/*/.blade.php',
],
};3 replies
Help: Form Repeater -> Make Values Selectable Only Once
Hi guys! Do you see any way to make Select/Toggle Values across repeater items selectable only once? It's a language select, and currently, a user can select German/English toggle twice and just save. I'm open for solutions. Thank you!
3 replies
Help: How to save data of a related model within a Filament form?
I'm trying to make the title of a
CourseResource
translatable into German and English. However, the translations are not being saved to the course_translations
table.
How can I handle the saving of fillable attributes that are in another table (relationship between 2 models) ?
In the Course model I have this:
And in the CourseTranslations this:
Unfortunately Spaties Translatable plugin doesn't suit my needs. :/
The DB tables exist for both both courses
and course_translations
.
Detailed Code with Course Model, CourseTranslation Model and Course Resource:
https://gist.github.com/Synistic/b033856ec909badfd09e6573feddb98f4 replies
Relationship for a translations table -> How to save entry?
Hello guys! I have a filament form with 2 tabs, where the user can enter translatable details in German and English
Issue: Currently the translations are not saved to the course_translations table. How can I save the English title in translations table to the locale "en" and the german one to the locale "de" ?
This is what the form components look like:
My course translation model:
And inside the Course model I have:
What's the best approach to realize this?
1 replies
How do Custom Components actually work? Can someone explain it to me?
Hi guys, I'm working on a custom component for the form of my "Video" resource.
Problem: I get the following error:
Undefined variable $record
I started to create a custom layout via php artisan make:form-layout BunnyVideo
. The Blade looks like this:
In addition I have this BunnyVideo Class:
I use the BunnyVideo component like this in the form function of the VideoResource: BunnyVideo::make('key'),
6 replies
Please help! What is the best way to use JS within Custom Pages?
Hello guys!
I have switched from Laravel Nova to Filament and am wondering what options I have to add JS components to my custom page.
I use the JS library “Uppy” to upload videos. With Command
php artisan make:filament-page VideoUploader
I now have a view file under:
resources/views/filament/resources/video-resource/pages/video-uploader.blade.php
Can I include dynamic JS components in this file? For example via Vue? I already work with vue in the user frontend, I only use filament for the admin dashboard.
What is the best approach in your experience?3 replies