Answers for "how to migration already field to unique in laravel"

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
1

laravel set field unique

Schema::table('manufacturers', function($table)
{
    $table->string('name')->unique(); 
});
Posted by: Guest on March-31-2020

Code answers related to "how to migration already field to unique in laravel"

Browse Popular Code Answers by Language