Roberto
Import CSV with tags in tags column
Hello there,
I'm trying to import csv that has tags in it like "google, bing" e,t,c in a tags column. all other columns are importing properly.
But, i'm unable to do that with tags
this is the code. please help me with example
ImportColumn::make('tags')
->label('Tags')
->rules(['nullable'])
->relationship()
->fillRecordUsing(function (Contact $record, $state) {
if (!empty($state)) {
$tagNames = explode(',', $state);
$tagIds = [];
foreach ($tagNames as $name) {
$name = trim($name);
if (!$name) continue;
$tag = Tag::firstOrCreate(
['name' => $name, 'user_id' => auth()->id()],
['description' => null]
);
$tagIds[] = $tag->id;
}
$record->tags()->sync($tagIds);
}
})
2 replies
How to display hasMany
hello there i have a User model relation to Link model
a user has many links
how do i display all links related to user using infolist?
which component should i use & which methods should i call to display list of links?
ty
3 replies
Some features not working on production
Hello there,
filament3 worked great on my computer. but when i deployed on production. it didn't work properly. some features are not working including
1. search functionality
2. polling of filament table
e.t.c
what could be the problem?
15 replies
how do i put my custom script code
I have a custom script code like this
<script></script>
i want to place that on every page of admin panel
i'm using renderHook. this is an example. please help me fix this
->renderHook(
'panels::body.end',
fn (): string => 'how do i put my script code here?'
)
6 replies