0

I was wondering, if it possible to add directly a value in the table. Because I would like that all with the value "1" are registered

Schema::table('games', function (Blueprint $table) {
        $table->integer('rankPosition', '1');
});

Update solution:

Schema::table('games', function (Blueprint $table) {
        table->integer('rankPosition')->default(1);
});
blackplan
  • 246
  • 2
  • 20
  • 2
    `table->integer('rankPosition')->default(1);` is how you would do that. The 2nd argument of `integer()` is for `$autoIncrement`, not the default value. (I think this is what you're trying to do, but your question is worded in a bit of an unclear manner) – Tim Lewis Aug 18 '21 at 14:21
  • 1
    No problem! Don't forget to check the documentation for this: https://laravel.com/docs/5.7/migrations, specifically https://laravel.com/docs/5.7/migrations#column-modifiers for your case. It's actually quite detailed and useful. Cheers! – Tim Lewis Aug 18 '21 at 14:28

0 Answers0