'boolean', 'effective_from' => 'datetime', 'effective_to' => 'datetime', ]; public function model() { return $this->belongsTo(DesignModel::class, 'model_id'); } public function bomTemplates() { return $this->hasMany(BomTemplate::class, 'model_version_id'); } public function scopeReleased($q) { return $q->where('status', 'RELEASED'); } }