Laravel: autocomplete for $table in migration scripts - developed.be

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


Rss Comments

Comments

No comments yet.

Leave a comment