Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel migration add unique column

Schema::table('tableName', function($table)
{
    $table->string('column-name')->unique(); //notice the parenthesis I added
});
 
PREVIOUS NEXT
Tagged: #laravel #migration #add #unique #column
ADD COMMENT
Topic
Name
8+8 =