Answers for "laravel migration change unique"

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
0

unique laravel migration

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

Schema::table('users', function (Blueprint $table) {
    $table->string('email')->unique();
});
Posted by: Guest on September-02-2021

Code answers related to "laravel migration change unique"

Browse Popular Code Answers by Language