Avriant
Avriant
FFilament
Created by Avriant on 7/25/2024 in #❓┊help
Chain filters in Table Search Text Input (hit enter -> add current input value as filter)?
Bump
5 replies
FFilament
Created by Avriant on 7/25/2024 in #❓┊help
Chain filters in Table Search Text Input (hit enter -> add current input value as filter)?
:depressed_tofu:
5 replies
FFilament
Created by Avriant on 7/25/2024 in #❓┊help
Chain filters in Table Search Text Input (hit enter -> add current input value as filter)?
:depressed_tofu:
5 replies
FFilament
Created by Avriant on 4/17/2024 in #❓┊help
Filament Wizard Save to Different Tables on each Step
Also bonus points if someone can tell me how to ->relationship directly on a Wizard without having to wrap the whole thing in FieldSet or Section, because this does not look good.
3 replies
FFilament
Created by Avriant on 3/1/2024 in #❓┊help
How to remove these inline styles (copy location returns undefined)
@Jo Solved it!
.choices__input--cloned {
@apply !min-w-[10ch];
}
.choices__input--cloned {
@apply !min-w-[10ch];
}
Obv you can use any value you like
20 replies
FFilament
Created by Avriant on 3/1/2024 in #❓┊help
How to remove these inline styles (copy location returns undefined)
Would it be too much to ask for an advice here? I mean both .choices__input and .fi-input allow me to access placeholder (as you can see, it is red-700 in this case), but any other style I try to assign gets overriden by that inline from Choices (which is weird, since important should override inline specificity afaik).
20 replies
FFilament
Created by Avriant on 3/1/2024 in #❓┊help
How to remove these inline styles (copy location returns undefined)
Can anyone on the Filament team confirm this? I'm trying to decide what my next step should be
20 replies
FFilament
Created by Avriant on 3/1/2024 in #❓┊help
How to remove these inline styles (copy location returns undefined)
BTW this issue does not appear for basic textual input, as my placeholders look nice and easy regardless of length
20 replies
FFilament
Created by Avriant on 3/1/2024 in #❓┊help
How to remove these inline styles (copy location returns undefined)
Yes, it could be that ch scales to latin charset and since average glyphs are wider you get this weird clipping/overflow
20 replies
FFilament
Created by Avriant on 3/1/2024 in #❓┊help
How to remove these inline styles (copy location returns undefined)
Oh, that schema
20 replies
FFilament
Created by Avriant on 3/1/2024 in #❓┊help
How to remove these inline styles (copy location returns undefined)
If this hypothesis gets validated, I suppose I'll just submit an issue on Filament repo
20 replies
FFilament
Created by Avriant on 3/1/2024 in #❓┊help
How to remove these inline styles (copy location returns undefined)
I had the same hypothesis actually, but I'm not an experienced developer to be sure of these things so thanks for the input!
20 replies
FFilament
Created by Avriant on 3/1/2024 in #❓┊help
How to remove these inline styles (copy location returns undefined)
By schema you mean all styling-related files? Sorry I got a little confused here 🙂
20 replies
FFilament
Created by Avriant on 10/5/2023 in #❓┊help
Custom Page (single page edit/view, no table view) saving 2 many-to-many relationships possible?
protected function getFormActions(): array {
return [
Action::make('save')
->label(__('filament-panels::resources/pages/edit-record.form.actions.save.label'))
->submit('保存'),
];
}

public function save(): void {
$tenant = Filament::getTenant();
$data = $this->form->getState();
$data['company_id'] = $tenant->id;
$companyID = $tenant->id;

$company = auth()->user()->companies->find($companyID);
$Entry = $company->regions();

// Check if a "general" entry already exists for this company
if ($company->regions === null) {
// If no "member" entry exists, create a new one
$Entry = new ModelsCompanyRegions;
$Entry->fill($data);
$Entry->save($data);

Notification::make()
->success()
->title('登録完了')
->send();
} else {
$Entry->update($data);
Notification::make()
->success()
->title('更新完了')
->send();
}
}
}
protected function getFormActions(): array {
return [
Action::make('save')
->label(__('filament-panels::resources/pages/edit-record.form.actions.save.label'))
->submit('保存'),
];
}

public function save(): void {
$tenant = Filament::getTenant();
$data = $this->form->getState();
$data['company_id'] = $tenant->id;
$companyID = $tenant->id;

$company = auth()->user()->companies->find($companyID);
$Entry = $company->regions();

// Check if a "general" entry already exists for this company
if ($company->regions === null) {
// If no "member" entry exists, create a new one
$Entry = new ModelsCompanyRegions;
$Entry->fill($data);
$Entry->save($data);

Notification::make()
->success()
->title('登録完了')
->send();
} else {
$Entry->update($data);
Notification::make()
->success()
->title('更新完了')
->send();
}
}
}
4 replies
FFilament
Created by Avriant on 10/5/2023 in #❓┊help
Custom Page (single page edit/view, no table view) saving 2 many-to-many relationships possible?
My custom page (saving IDs as JSONs)
class CompanyRegions extends Page implements HasForms
{
public function mount(): void {
$tenant = Filament::getTenant();
$companyID = $tenant->id;
$companyRegions = auth()->user()->companies->find($companyID)->regions;

if($companyRegions === null) {
$this->form->fill();
} else {
$this->form->fill(auth()->user()->companies->find($companyID)->regions->attributesToArray());
}
}

public function form(Form $form): Form
{
return $form
->schema([
Select::make('prefectures')
->placeholder('活動県選択')
->label('県')
->options(Prefecture::all()->pluck('prefecture_ja', 'id'))
->multiple()
->searchable()
->required(),
Select::make('cities')
->placeholder('活動市選択')
->label('市')
->options(City::all()->pluck('city_ja', 'id'))
->multiple()
->searchable()
->required(),
])
->statePath('data');
}
class CompanyRegions extends Page implements HasForms
{
public function mount(): void {
$tenant = Filament::getTenant();
$companyID = $tenant->id;
$companyRegions = auth()->user()->companies->find($companyID)->regions;

if($companyRegions === null) {
$this->form->fill();
} else {
$this->form->fill(auth()->user()->companies->find($companyID)->regions->attributesToArray());
}
}

public function form(Form $form): Form
{
return $form
->schema([
Select::make('prefectures')
->placeholder('活動県選択')
->label('県')
->options(Prefecture::all()->pluck('prefecture_ja', 'id'))
->multiple()
->searchable()
->required(),
Select::make('cities')
->placeholder('活動市選択')
->label('市')
->options(City::all()->pluck('city_ja', 'id'))
->multiple()
->searchable()
->required(),
])
->statePath('data');
}
4 replies