reconstruction of the project
This commit is contained in:
@@ -2,11 +2,15 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Models\BaseModel;
|
||||
|
||||
class ClassPreparationLog extends Model
|
||||
class ClassPreparationLog extends BaseModel
|
||||
{
|
||||
protected $table = 'class_preparation_log';
|
||||
|
||||
// CI: useTimestamps = false
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'class_section_id',
|
||||
'class_section',
|
||||
@@ -14,5 +18,16 @@ class ClassPreparationLog extends Model
|
||||
'prep_data',
|
||||
'created_at',
|
||||
];
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'class_section_id' => 'integer',
|
||||
// If prep_data is JSON in DB, use 'array' (or 'json') cast:
|
||||
'prep_data' => 'array',
|
||||
];
|
||||
|
||||
// Optional relationship
|
||||
public function classSection()
|
||||
{
|
||||
return $this->belongsTo(ClassSection::class, 'class_section_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user