Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel migration add unique column

Schema::table('tableName', function($table)
{
    $table->string('column-name')->unique(); //notice the parenthesis I added
});
Comment

unique laravel migration

use IlluminateDatabaseSchemaBlueprint;
use IlluminateSupportFacadesSchema;

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

laravel migration alter column unique

$table->dropUnique('users_email_unique');
Comment

PREVIOUS NEXT
Code Example
Php :: merge array 
Php :: laravel pagination with query string, laravel pagination with string 
Php :: how to get index 2nd php 
Php :: woocommerce get orders by user id 
Php :: laravel validation in controller 
Php :: php variable in echo 
Php :: openssl encrypt php with key 
Php :: laravel npm run dev mix error FIX 
Php :: Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1 
Php :: concat php 
Php :: php xml string 
Php :: json encode decode 
Php :: phpserver 
Php :: php-pdo-returning-single-row 
Php :: php showing code in browser 
Php :: ver version de php en linux 
Php :: php rand int 
Php :: Mixed Content: The page at was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 
Php :: laravel get from model first 
Php :: laravel value eloquent 
Php :: count_chars (PHP 4, PHP 5, PHP 7, PHP 8) count_chars — Return information about characters used in a string 
Php :: laravel restrict route methods 
Php :: explode example in php 
Php :: laravel livewire-datatable delete column pop up issue 
Php :: how to make custom logiger in laravel 
Php :: how to read sqlite file in php 
Php :: php disable buutton 
Php :: laravel db table get one columns value 
Php :: php multiple variables assign same value 
Php :: eloquent where comparing two columns 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =