Files
nutzwerte_fi4/app/Models/ProjektMethode.php
T
2026-07-06 09:02:20 +02:00

40 lines
787 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ProjektMethode extends Model
{
protected $fillable = [
'projekte_id',
'cloned_from_id',
'methode_id',
'aufstellung_id',
'geschoss',
'raumart',
'faktor',
];
public static function boot()
{
parent::boot();
self::updated(function ($model) {
Projekte::where('id', $model['projekte_id'])->update([
'evaluation_gutachten' => false,
]);
});
}
public function methode()
{
return $this->hasOne(Methode::class, 'id', 'methode_id');
}
public function aufstellung()
{
return $this->hasOne(Aufstellung::class, 'id', 'aufstellung_id');
}
}