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 :: get file each line in php 
Php :: how to hide .php extension using .htaccess 
Php :: remove gutenberg styles 
Php :: Find out how many years there are in php between years 
Php :: laravel carbon get month number 
Php :: phpstan ignore 
Php :: allert in php 
Php :: brew install php with specific version 
Php :: repeater acf 
Php :: how to create a new component in laravel 
Php :: php reset mysql array 
Php :: mysql timestamp format php 
Php :: php extract zip 
Php :: check if post id exists wordpress 
Php :: laravel carbon create date from string 
Php :: wp_query limit 1 
Php :: Split 10 email out of 50 email using coma separated via php 
Php :: disable edit-link storefront 
Php :: loop variable in laravel 
Php :: get message validator failed laravel 
Php :: how to test that function throws an exception in pest 
Php :: laravel check php version 
Php :: laravel remove public from url 
Php :: phpmailer for wordpress 
Php :: php error display 
Php :: rus text check php 
Php :: php divide string into parts 
Php :: email php using html 
Php :: verificare esistenza file in php 
Php :: cut out the beginning of the text in php 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =