Create Postgres Numeric Field in Laravel 5.1

1

I need to create a field of type numeric existing in postgres using migrations of laravel, can someone tell me how to do it?

I tried this but did not rotate:

public function up()
{
    Schema::create('complementos', function (Blueprint $table) {
        $table->increments('id');
        $table->numeric('comprimento');
        $table->timestamps();
    });
}

I need to store values of 50.00 , with the decimal places right, saving the zeros after the period. If you really can not create the numeric , what other type could I use?

Error while running migrate:

  

[Symfony \ Component \ Debug \ Exception \ FatalErrorException]

     

Call to undefined method   Illuminate \ Database \ Schema \ Blueprint :: numeric ()

    
asked by anonymous 14.04.2016 / 21:11

1 answer

3

Already resolved in the chat, but who comes from outside here is the form:

$ table-> decimal ('FIELD', 5, 2);

    
14.04.2016 / 22:16