Skip to content

[12.x] Use searchable prompt for db:table command#58442

Merged
taylorotwell merged 3 commits intolaravel:12.xfrom
sakshamgorey:feat/add-search-to-table-command
Jan 20, 2026
Merged

[12.x] Use searchable prompt for db:table command#58442
taylorotwell merged 3 commits intolaravel:12.xfrom
sakshamgorey:feat/add-search-to-table-command

Conversation

@sakshamgorey
Copy link
Contributor

Description

This PR updates the php artisan db:table command to use the search prompt instead of select.

Why

Currently, the db:table command uses a standard list selection. In applications with large database schemas (50+ tables), finding a specific table requires scrolling through the entire list. The current select component does not support filtering by typing.

Demo

Before (Standard Scrolling) After (Searchable)
Before After

Implementation Details

  • I have optimized the logic by generating the collection of table names once, outside the search closure.
  • Ensures ->values() is called on the collection to prevent array key issues within the prompt component.

@shaedrich
Copy link
Contributor

Would it make sense to filter by connection first if there are multiple? If not, the prefix can be dropped

@sakshamgorey
Copy link
Contributor Author

thanks @shaedrich , yeah i will improve that

@sakshamgorey
Copy link
Contributor Author

sakshamgorey commented Jan 20, 2026

hey @shaedrich, i did some research this is the same behavior we previously had when using select.

@shaedrich
Copy link
Contributor

Ah, okay—thanks for checking 👍🏻

@taylorotwell taylorotwell merged commit 0db5e88 into laravel:12.x Jan 20, 2026
68 of 70 checks passed
@sakshamgorey sakshamgorey deleted the feat/add-search-to-table-command branch January 30, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments