Unique with soft delete
public function up(): void
{
Schema::create('brands', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->mediumText('description')->nullable();
$table->softDeletes(); // This line adds the soft delete functionality
$table->timestamps();
$table->unique('name','deleted_at');
});
}
i am trying to have unique name but i also have soft delete
is there is any way
???
{
Schema::create('brands', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->mediumText('description')->nullable();
$table->softDeletes(); // This line adds the soft delete functionality
$table->timestamps();
$table->unique('name','deleted_at');
});
}
i am trying to have unique name but i also have soft delete
is there is any way
???