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 table in laravel

$table->enum('priority', ['normal', 'medium', 'high'])->default('normal');
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 :: php expire a session 
Php :: Barcode generator example using milon/barcode in laravel 
Php :: datetime get month php 
Php :: laravel rule unique ignore 
Php :: permissions for laravel deployment 
Php :: for each loop syntax in laravel 
Php :: php number format 
Php :: how to change date formate in php 
Php :: how to check php version in php 
Php :: tl to usd 
Php :: livewire sortable 
Php :: add log in laravel 
Php :: Flutter migrate to Android Studio 
Php :: password_hash 
Php :: creer un modele laravel 
Php :: convert array to object php 
Php :: laravel db query 
Php :: php sort array of array by key 
Php :: php check if value exists in multidimensional array 
Php :: laravel deploy without moving public directory 
Php :: php artisan update table 
Php :: laravel session 
Php :: difference entre deux date php 
Php :: laravel unsigned integer 
Php :: change password function in laravel 
Php :: 2 decimal round using php 
Php :: laravel controller store 
Php :: take and skip in laravel 
Php :: php get url parameter 
Php :: send html email laravel 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =