Migration with custom fields in Laravel

Asked

Viewed 130 times

1

Accustomed to the existing Migration facilities in Asp.net MVC, I have the following question:

Is there a way to create Fields in my Model and when running Migration the framework automatically create these fields in my Up method? In the documentation and tutorials I see, it is always necessary to change the Migration class and enter the fields manually.

In Asp.net MVC Migration automatically creates the fields according to my Model class.

That’s possible in the Laravel?

Example, class with "Name, Phone" fields. The Up method would automatically create the

$table->string('nome'); $table->string('telefone');
  • Not because in PHP you don’t need to declare fields beforehand.

  • Gee, too bad, I’ll miss it! But thank you so much for the reply @LINQ

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.