Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel table data types

$table->bigIncrements('id'); 	Incrementing ID using a "big integer" equivalent.
$table->bigInteger('votes'); 	BIGINT equivalent to the table
$table->binary('data'); 	BLOB equivalent to the table
$table->boolean('confirmed'); 	BOOLEAN equivalent to the table
$table->char('name', 4); 	CHAR equivalent with a length
$table->date('created_at'); 	DATE equivalent to the table
$table->dateTime('created_at'); 	DATETIME equivalent to the table
$table->decimal('amount', 5, 2); 	DECIMAL equivalent with a precision and scale
$table->double('column', 15, 8); 	DOUBLE equivalent with precision, 15 digits in total and 8 after the decimal point
$table->enum('choices', array('foo', 'bar')); 	ENUM equivalent to the table
$table->float('amount'); 	FLOAT equivalent to the table
$table->increments('id'); 	Incrementing ID to the table (primary key).
$table->integer('votes'); 	INTEGER equivalent to the table
$table->longText('description'); 	LONGTEXT equivalent to the table
$table->mediumInteger('numbers'); 	MEDIUMINT equivalent to the table
$table->mediumText('description'); 	MEDIUMTEXT equivalent to the table
$table->morphs('taggable'); 	Adds INTEGER taggable_id and STRING taggable_type
$table->nullableTimestamps(); 	Same as timestamps(), except allows NULLs
$table->smallInteger('votes'); 	SMALLINT equivalent to the table
$table->tinyInteger('numbers'); 	TINYINT equivalent to the table
$table->softDeletes(); 	Adds deleted_at column for soft deletes
$table->string('email'); 	VARCHAR equivalent column
$table->string('name', 100); 	VARCHAR equivalent with a length
$table->text('description'); 	TEXT equivalent to the table
$table->time('sunrise'); 	TIME equivalent to the table
$table->timestamp('added_on'); 	TIMESTAMP equivalent to the table
$table->timestamps(); 	Adds created_at and updated_at columns
$table->rememberToken(); 	Adds remember_token as VARCHAR(100) NULL
->nullable() 	Designate that the column allows NULL values
->default($value) 	Declare a default value for a column
->unsigned() 	Set INTEGER to UNSIGNED
Comment

laravel field types from database field type

// in laravel if error of missing pdomysql driver issue the command
// composer require doctrine/dbal
DB::connection()->getDoctrineColumn($table_name, $field_name)->getType()->getName()
Comment

laravel data type

laravel table data types
Comment

PREVIOUS NEXT
Code Example
Php :: what should write for getting extension of image in php 
Php :: how to install mysql and phpmyadmin on windows 10 
Php :: simple php round example 
Php :: display picture in pdf generated with laravel 
Php :: how use variable in string in laravel 
Php :: store a variable in session and echo that variable on a page wordpress 
Php :: enable cors cakephp 
Php :: php oop crud database 
Php :: laravel transaction 
Php :: laravel create custom artisan command 
Php :: laravel carbon y-m-d 
Php :: setup PDO 
Php :: laravel edit 
Java :: how to detect operating system in java 
Java :: bukkit scoreboard 
Java :: Console color text java 
Java :: full screen in jframe 
Java :: java integer to binary string with leading zeros 
Java :: how to clear the screen by pressing a key in java 
Java :: JFrame Exit oon close Java20 
Java :: how to validate email java 
Java :: How to turn off darkmode for my app in android studio 
Java :: java print treemap 
Java :: java android play sound file with variable 
Java :: how to format ddmmmyyyy to ddmmyy in java 
Java :: android studio edittext text change listener 
Java :: hello world in javacsript 
Java :: java how to get elapsedTime 
Java :: new hashmap java 
Java :: read file using scanner in java 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =