plugin icon indicating copy to clipboard operation
plugin copied to clipboard

[Feature Request]: Add table columns autocomplete in `->after()` and `->foreignid()` in migrations

Open ralphjsmit opened this issue 3 years ago • 0 comments

Feature Description

When writing migrations, I often use the ->after() method to put a column at a certain position (so that my created_at and updated_at columns stay at the end).

It would be nice if this function call could be auto-completed. Since you already have autocompletion for columns on models e.t.c., I figured that this probably isn't much work, so I just wanted to share the idea.

At the same time, it would be nice if the ->foreignId() function call could also be autocompleted with the names of other tables, suffixed with _id.

For example, if we have the following tables:

  • users
  • posts
  • pages

And I'm writing the following migration:

Schema::table('users', function(Blueprint $table) {
    $table->foreignId(/** */); // <!-- Autocompletion for "page_id" and "post_id"
});

Those points aren't a big deal of course, but if it's easy to implement, it would be nice to have them.

Thanks!

ralphjsmit avatar Jul 16 '22 13:07 ralphjsmit