Search
 
SCRIPT & CODE EXAMPLE
 

PHP

unique value when two columns laravel migration

public function up()
{
    Schema::table('user_plans', function (Blueprint $table) {
        $table->unique(["email", "plan_id"], 'user_plan_unique');
    });
}

public function down()
{
    Schema::table('user_plans', function (Blueprint $table) {
      $table->dropUnique('user_plan_unique');
    });
}
Comment

PREVIOUS NEXT
Code Example
Php :: php date strtotime add days 
Php :: laravel vendor publish all files 
Php :: Error: Call to a member function addEagerConstraints() on null in file 
Php :: foreach comma separated string php 
Php :: intl extension php ubuntu 
Php :: php default timezone 
Php :: laravel grouping routes 
Php :: wordpress define constant if not defined 
Php :: php header 500 
Php :: how to hide .php extension using .htaccess 
Php :: wordpress print post data 
Php :: Date and Time PHP Continued 
Php :: array to object php 
Php :: show php info 
Php :: php reset mysql array 
Php :: year in php 
Php :: string date less than now php 
Php :: Internal error: xmlSchemaDocWalk, calling xmlSchemaValidateElem(). 
Php :: wp cli command activate plugin 
Php :: admin bar hide wordpress 
Php :: php kril to eng 
Php :: create custom domain in localhost xampp 
Php :: php sleep 1 second 
Php :: get youtube thumbnail php 
Php :: how to delete image from floder in laravel 
Php :: cart icon in woocommerce 
Php :: check php version mac 
Php :: rus text check php 
Php :: Warning: mysqli_error() expects exactly 1 parameter, 0 
Php :: get_boundary_post wordpress 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =