unique laravel migration

54

unique laravel migration -

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

Schema::table('users', function (Blueprint $table) {
    $table->string('email')->unique();
});

laravel set field unique -

Schema::table('manufacturers', function($table)
{
    $table->string('name')->unique(); 
});

Comments

Submit
0 Comments