'integer', 'teacher_id' => 'integer', // change to 'datetime' if your columns are DATETIME 'week_start' => 'date', 'week_end' => 'date', // If flags_json is JSON in DB, this makes it an array automatically 'flags_json' => 'array', ]; /* Optional relationships */ public function classSection() { return $this->belongsTo(ClassSection::class, 'class_section_id'); } public function teacher() { return $this->belongsTo(User::class, 'teacher_id'); } public function attachments() { return $this->hasMany(ClassProgressAttachment::class, 'report_id'); } }