Laravel: autocomplete for $table in migration scripts

A quick tip: if you want autocomplete (intellisense) when writing migrations in Laravel, you can add type hinting for the $table variable.

Just add Blueprint before $table in the function argument. Blueprint is the type of the $table variable. You’ll be able to see all the options and don’t have to check Laravel docs anymore.

class Payments extends Migration {

public function up() {
Schema::create('donor_account', function(Blueprint $table){
$table->engine ='InnoDB';
$table->increments('id');

This is how it looks in PHPStorm 8:

phpstorm_table_autocomplete

You May Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.