Remi Hindriks
Remi Hindriks
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.
22 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);
}
4 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