Mads Møller
Mads Møller
FFilament
Created by Koda on 6/13/2024 in #❓┊help
TextInput with an autocomplete function
try this. works for me.
TextInput::make('some_field_name')
->live(debounce:400)
->autocomplete(false)
->datalist(function(Set $set, $state) {
$data = [];
if($state != null && Str::length($state) > 2) {
$data = MyModel::query()
->select('title')
->where('title', 'LIKE', '%' . $state . '%')
->limit(5)
->pluck('title')
->toArray();
}

return $data;
})
->required(),
TextInput::make('some_field_name')
->live(debounce:400)
->autocomplete(false)
->datalist(function(Set $set, $state) {
$data = [];
if($state != null && Str::length($state) > 2) {
$data = MyModel::query()
->select('title')
->where('title', 'LIKE', '%' . $state . '%')
->limit(5)
->pluck('title')
->toArray();
}

return $data;
})
->required(),
9 replies
FFilament
Created by Mads Møller on 11/3/2023 in #❓┊help
testing panels in pest?
Thank you @tim_vdv the below did the trick \Filament\Facades\Filament::setCurrentPanel(\Filament\Facades\Filament::getPanel('app')); \Filament\Facades\Filament::setTenant($organization);
8 replies
FFilament
Created by Mads Møller on 11/3/2023 in #❓┊help
testing panels in pest?
But wait.. this still is not the solution, as the livewire helper is not working as expected: livewire(SomeResource\Pages\ListTextEntries::class) ->assertCanSeeTableRecords($textEntries); This still gets the wrong route.
8 replies
FFilament
Created by Mads Møller on 11/3/2023 in #❓┊help
testing panels in pest?
wait.. it works. Thanks very much!
8 replies
FFilament
Created by Mads Møller on 11/3/2023 in #❓┊help
testing panels in pest?
Hi Connor, I do: $this->get(TenantResource::getUrl(name:'index', panel:'app')) But it still returns the admin route which is a "route not defined" exception.
8 replies
FFilament
Created by awsqed on 10/10/2023 in #❓┊help
Register new chart type
I have a vey similar challenge, as I want to register a chartjs plugin.
import { Chart } from 'chart.js';
import annotationPlugin from 'chartjs-plugin-annotation';

Chart.register(annotationPlugin);
import { Chart } from 'chart.js';
import annotationPlugin from 'chartjs-plugin-annotation';

Chart.register(annotationPlugin);
8 replies