mercredi 18 août 2021

Laravel 5.7: Is it possible to add direct a value in the table?

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);
});


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire