Answers for "how to add unique in data existing table in laravel 8"

PHP
1

laravel migration add unique column

Schema::table('tableName', function($table)
{
    $table->string('column-name')->unique(); //notice the parenthesis I added
});
Posted by: Guest on November-20-2020

Code answers related to "how to add unique in data existing table in laravel 8"

Browse Popular Code Answers by Language