how to use data type as "blob" during migration in Laravel 6

Viewed 9069

I want to store HTML in the database as blob data type when I try to migrate getting errors

Schema::create('projects', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('project_name');
            $table->blob('project_description');
            $table->timestamps();
        });
    }
php artisan module:migrate projects
Migrating: 2019_10_17_125423_create_projects_table

BadMethodCallException : Method Illuminate\Database\Schema\Blueprint::blob does not exist.

at xampp\htdocs\minidmsapi\vendor\laravel\framework\src\Illuminate\Support\Traits\Macroable.php:104

1 Answers

In Laravel they have binary instead of blob. binary is equivalent to blob.

You can use it like:

$table->binary('name'); 

For more information see docs.

Thanks

Related