mrpunyapal/filament-infinite-select/infinite-select

Claude Code and agent skill by mrpunyapal/filament-infinite-select

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when adding or debugging lazy-loading select fields in Filament forms with MrPunyapal/FilamentInfiniteSelect: pagination closure contract, hasMore detection, label resolvers for saved values, multiple selection storage, and asset publishing.

Install

npx vskill@latest install mrpunyapal/filament-infinite-select/infinite-select

SKILL.md

InfiniteSelect Usage Guidelines

InfiniteSelect is a Filament form component that loads select options one page at a time as the user scrolls. Use it instead of Select::make() when a field can have hundreds or thousands of options.

Required setup

Every InfiniteSelect needs a pagination closure. It receives $offset, $limit, and $search by name:

php
use MrPunyapal\FilamentInfiniteSelect\InfiniteSelect;
InfiniteSelect::make('user_id')
->getPaginatedOptionsUsing(function (int $offset, int $limit, ?string $search) {
$query = User::query()->orderBy('name');
if ($search) {
$query->where('name', 'like', "%{$search}%");
}
return [
'options' => $query->skip($offset)->take($limit)->pluck('name', 'id')->all(),
'hasMore' => ($offset + $limit) < (clone $query)->count(),
];
});

Rules for the closure:

  • Apply $search on every page of results, not only offset 0.
  • Return 'options' as a value-to-label array and 'hasMore' as a bool.
  • Collections are fine; they are converted automatically.
  • Prefer fetching $limit + 1 rows over a separate count() query:
php
$rows = $query->skip($offset)->take($limit + 1)->get();
return [
'options' => $rows->take($limit)->pluck('name', 'id')->all(),
'hasMore' => $rows->count() > $limit,
];

Saved values need label resolvers

Loaded pages may not contain previously saved values. Without a resolver, edit forms show raw IDs:

php
// Single select
->getOptionLabelUsing(fn ($value) => User::find($value)?->name)
// Multiple select
->getOptionLabelsUsing(fn (array $values) => User::whereIn('id', $values)->pluck('name', 'id')->all())

Multiple selection

Add ->multiple(). State is a plain array. Store it as JSON with an 'array' cast when there is no pivot table, or use a standard BelongsToMany.

Configuration options

MethodDefaultControls
perPage()15Rows per page
preloadFirstPage()falseRender page one server side
searchDebounce()300Search delay in ms
scrollThreshold()50Pixels from bottom that trigger loading

All accept closures evaluated at render time.

Asset publishing

The Alpine component is a Filament asset. If the select renders but never loads options, check for a 404 on /js/mrpunyapal/filament-infinite-select/components/infinite-select.js and run:

bash
php artisan filament:assets

When working against a local clone through a Composer path repository, re-run this command after rebuilding the package JavaScript.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/mrpunyapal/filament-infinite-select/infinite-select/badge)](https://verified-skill.com/skills/mrpunyapal/filament-infinite-select/infinite-select)

Something wrong with this skill or its page? Tell us.