Remi Hindriks
Remi Hindriks
FFilament
Created by Remi Hindriks on 10/11/2024 in #❓┊help
afterStateUpdated not firing when removing from multiple FileUpload
I have a FileUpload field in a custom Livewire component:
FileUpload::make('images')
->disk('public')
->directory('temporary')
->preserveFilenames()
->label('')
->multiple()
->maxFiles(10)
->image()
->panelLayout('grid')
->afterStateUpdated(function ($state) {
Log::info('images updated');
}),
FileUpload::make('images')
->disk('public')
->directory('temporary')
->preserveFilenames()
->label('')
->multiple()
->maxFiles(10)
->image()
->panelLayout('grid')
->afterStateUpdated(function ($state) {
Log::info('images updated');
}),
When i select 5 images, "images updated" is logged 5 times", but when i remove an image, it doesn't add another. Eventhough the state has been updated. I went from 5 images to 4.
3 replies
FFilament
Created by Remi Hindriks on 8/6/2024 in #❓┊help
isLimited combined with getTableRecordActionUsing breaks
Using the table package, I created a table in a Livewire component. Everything works, until I add the combination of an expandableList and getTableRecordActionUsing() The problem is getTableRecordActionUsing() adds a wrapper button on every cell in the table, but the button to toggle isLimited, is put outside of this wrapper. Thus Alpine throwing an error because the isLimited alpine object, it outside of the scope of the "show more" button. Is this a Filament bug? or Am I doing something wrong?
5 replies
FFilament
Created by Remi Hindriks on 7/19/2024 in #❓┊help
multiselect creates groups after selecting first item
No description
3 replies
FFilament
Created by Remi Hindriks on 7/8/2024 in #❓┊help
ExpandableList isLimited not defined Tables Package
No description
7 replies
FFilament
Created by Remi Hindriks on 5/19/2024 in #❓┊help
team planning tool
Has anyone used Filament to build a team planning tool? Im thinking i need TeamMembers who have schedules, and projects. Then i need to be able to appoint hours per day for teammembers linked to a project. Ex. User1 is working for 4 hours on projectX next Tuesday. Does anyone have a project like this theyd be willing to share?
2 replies
FFilament
Created by Remi Hindriks on 5/3/2024 in #❓┊help
Multiple Select that creates on submit
I have a Select in a form that allows users to attach Skill resources to themselves.
Select::make('skills')
->relationship(name: 'skills', titleAttribute: 'title')
->multiple()
Select::make('skills')
->relationship(name: 'skills', titleAttribute: 'title')
->multiple()
I added a create form for not existing skills:
->createOptionForm([
TextInput::make('title')
->required(),
])
->createOptionForm([
TextInput::make('title')
->required(),
])
But because my Skill Model only has one field, I was hoping to use the search value of the select When a user searches the select for a skill, but it isn't found because it doesnt exist yet. Hitting Enter should create the skill using the search value and attach it. has anyone been able to do this with Filament?
2 replies
FFilament
Created by Remi Hindriks on 4/30/2024 in #❓┊help
Bulk Actions Large Datasets
When trying to execute bulk actions on a dataset of 200 user models, i get memory issues. For example when I try to export more than 200 user models using the ExportBulkAction, my application freezes. is there anyway to optimize this? Am I doing something wrong? exporting 400 users doesnt sound like it should be an issue.
26 replies
FFilament
Created by Remi Hindriks on 4/19/2024 in #❓┊help
Nested arrays may not be passed to whereIn method.
Using the Forms package i'm creating an edit field for a user. They can update their skills using a multiple select. But when loading the page im hit with "Nested Arrays may not be passed to whereIn method" my component:
public User $user;
public array $data;

public function mount(): void
{
$this->user = auth()->user();
$this->form->fill($this->user->toArray());
}

public function form(Form $form): Form
{
return $form
->schema([
Select::make('skills')
->relationship('skills', 'title')
->searchable()
->label(__('Skills'))
->multiple()
])
->statePath('data')
->model($this->user);
}
public User $user;
public array $data;

public function mount(): void
{
$this->user = auth()->user();
$this->form->fill($this->user->toArray());
}

public function form(Form $form): Form
{
return $form
->schema([
Select::make('skills')
->relationship('skills', 'title')
->searchable()
->label(__('Skills'))
->multiple()
])
->statePath('data')
->model($this->user);
}
5 replies
FFilament
Created by Remi Hindriks on 4/17/2024 in #❓┊help
Setup styling when using both adminpanel and forms package on the frontend
I'm using the adminpanel, but also the forms package. the adminpanel is just for me and my fellow admins, the forms package is used by customers on the front-end. I find it hard to figure out how to use different styling for both. Can someone point me to the right docs, or tutorial on how to set this up?
3 replies
FFilament
Created by Remi Hindriks on 4/5/2024 in #❓┊help
Export Action Notifies wrong user
Our app uses the Admin panel on the back for the User model, but also the table, actions, form and notification packages on the front for the Customer model. We've updated the exports table to be a morph relation, so the action can be triggered by either a User or a Customer. Which is fine, this seems to work fine in creating the Export record in the database. But the notification always goes to the User model. So the export generated has a user_type of \App\Models\Customer and a user_id of 16, but the Notification goes to the \App\Models\User with id 16 How can i make sure my Notifications are also sent to the right model? Its as if when creating Exports
if (static::hasPolymorphicUserRelationship()) {
return $this->morphTo();
}
if (static::hasPolymorphicUserRelationship()) {
return $this->morphTo();
}
This works, but not when the notification is created in the ExportCompletion Job....
2 replies
FFilament
Created by Remi Hindriks on 3/26/2024 in #❓┊help
using @livewireScriptConfig instead of @filamentScripts
I'm using the tables package in livewire components. I'm using an extra Alpine plugin. So following the Livewire docs in my app.js i added
import { Livewire, Alpine } from '../../vendor/livewire/livewire/dist/livewire.esm';
Alpine.directive('tooltip', (el) => {
tippy(el, { content: el.textContent });
});

Livewire.start()
import { Livewire, Alpine } from '../../vendor/livewire/livewire/dist/livewire.esm';
Alpine.directive('tooltip', (el) => {
tippy(el, { content: el.textContent });
});

Livewire.start()
In order to not get 2 instances of Livewire i need to add @livewireScriptConfig But now the loading indicator in my searchbar of my table is constantly spinning. Am i doing something wrong?
3 replies
FFilament
Created by Remi Hindriks on 3/19/2024 in #❓┊help
LocaleSwitcher as Tabs instead of Select
Has anyone created a LocaleSwitcher using tabs instead of the Select Action? I'd like my dashboard to show tabs for alle languages instead of switching using the select.
2 replies
FFilament
Created by Remi Hindriks on 2/27/2024 in #❓┊help
Spatie Translatable Plugin and relationship fieldset
My Page model has a MorphOne relationship to the Seo model. The Seo model has columns like title and description. In my PageResource i have a fieldset for the Seo relationship:
Forms\Components\Fieldset::make('seo')
->relationship(name: 'seo')
->schema([
Forms\Components\TextInput::make('title')
->label(__('SEO title'))
->string(),

Forms\Components\Textarea::make('description')
->label(__('SEO description'))
->string(),
]),
Forms\Components\Fieldset::make('seo')
->relationship(name: 'seo')
->schema([
Forms\Components\TextInput::make('title')
->label(__('SEO title'))
->string(),

Forms\Components\Textarea::make('description')
->label(__('SEO description'))
->string(),
]),
This works just fine. Until i add the Spatie Translatable Plugin. I found out adding the relationship name to the translatable array on the page model made the language selector "work" on the related textInputs: public array $translatable = ['title', 'seo']; Now when i switch languages using the LocaleSwitcher on the create or edit screen, the inputs seem to store the data per language. When i enter just 1 language, no issue, but when i set multiple language variables and save it, i get an error
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'seo' in 'field list'
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'seo' in 'field list'
Now all of a sudden the seo isn't stored as a relationship but as a column on the page model. the raw query is: update pages set title = ?, seo = ?, pages.updated_at = ? where id = ? Any ideas would be welcome
4 replies
FFilament
Created by Remi Hindriks on 9/29/2023 in #❓┊help
Form builder theme
Im using the form builder without panels to show forms on my front-end. But i'm also using the panels for the backend. using ->viteTheme('resources/css/filament/admin/theme.css') styles the backend panels, but not the frontend. Is there a way to create a theme, or load the admin panel css to style the form on the front-end?
3 replies