laravel tinyInteger and tinyText type migration

Here we will discuss laravel tinyInteger and tinyText type migration. what use of tinyInteger and tinyText migration. laravel migration tutorials.

Laravel tinyInteger migration

Laravel tinyInteger() migration create mysql TINYINT type column and it is smallest size integer (1 byte).

public function up()
{
    Schema::create('users', function (Blueprint $table) {
        $table->tinyInteger('age');
    });
}

Laravel tinyText migration

Laravel tinyText() migration creates MySQL TINYTEXT type column. But in some time laravel gives Method Illuminate\Database\Schema\Blueprint::tinyText does not exist error in that case you can make a string-type column with the required length.

public function up()
{
    Schema::create('users', function (Blueprint $table) {
        $table->tinyText('notes');
    });
}
php laravel developer anmol sharma

Anmol Sharma

I am a software engineer and have experience in web development technologies like php, Laravel, Codeigniter, javascript, jquery, bootstrap and I like to share my deep knowledge by these blogs.

Random tutorial links