Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel enum migration example

$table->enum('animal_type',['cat','dog','unknown'])->default('unknown');
Comment

laravel enum migration

Add Laravel enmu migration : 
------------------------------
$table->enum('question_type', ['objective', 'subjective', 'multiple_choice']);

Update Laravel enum migration :
---------------------------------
DB::statement("ALTER TABLE users CHANGE COLUMN permissions permissions ENUM('admin', 'user', 'candidate') NOT NULL DEFAULT 'user'");
Comment

enum in laravel migration

$table->enum('gender',['Male','Female'])->default('Male');
Comment

enum in migration laravel

// For identifying user
$table->enum('is_admin',['1','0'])->default('1');

// For User roles
$table->enum('user_role',['admin','manager','quest'])->default('quest');
Comment

Laravel Migration - Update Enum Options

DB::statement("ALTER TABLE users CHANGE COLUMN permissions permissions ENUM('admin', 'user', 'candidate') NOT NULL DEFAULT 'user'");
Comment

PREVIOUS NEXT
Code Example
Php :: How to Add Custom Fonts to a WordPress Theme 
Php :: php json_encode indent 
Php :: alert for empty input in php 
Php :: dd php 
Php :: check current user role 
Php :: wordpress limit post content length 
Php :: sort an array in php manually 
Php :: jquery is less than or equal to 
Php :: php get first element of iterator class 
Php :: alert message in blade template with() 
Php :: laravel multiple copy record 
Php :: laravel route multiple middleware 
Php :: php try to decode json 
Php :: laravel array in lang 
Php :: if home else php wordpress 
Php :: laravel uuid not showing in query 
Php :: php aes 
Php :: php webserver 
Php :: create a module laravel 
Php :: drupal 7 db_query example 
Php :: php inline if condition date time 
Php :: Laravel Migrations from an existing database 
Php :: downgrade php version 
Php :: sum two numbers in php 
Php :: php sort by key 
Php :: convert html to pdf using php.php 
Php :: referencing constant in config laravel 
Php :: strtotime php 
Php :: laravel migration mediumtext length 
Php :: vindecoder.eu php 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =