I am getting an error while migrating my tables. the error says
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json null,
start_datedate not null,end_datedate not null,statusenum('' at line 1 (SQL: create tablemodules(idint unsigned not null auto_increment primary key,titlevarchar(191) not null,descriptiontext not null,imageblob null,resourcesjson null,start_datedate not null,end_datedate not null,statusenum('pending', 'start', 'completed') not null default 'pending',user_idint not null,created_attimestamp null,updated_attimestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
my table have following values:
public function up()
{
Schema::create('modules', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('description');
$table->binary('image')->nullable();
$table->json('resources')->nullable();
$table->date('start_date');
$table->date('end_date');
$table->ENUM('status',['pending','start','completed'])->default('pending');
$table->integer('user_id');
$table->timestamps();
});
}
this is my model code:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class modules extends Model
{
protected $fillable = [
'title', 'description','image','resources', 'start_date','end_date','status','user_id',
];
}
can anyone have the solution for this??