Files
nutzwerte_fi4/app/Models/ProjektMethode.php
T
2025-11-18 17:57:58 +01:00

38 lines
736 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ProjektMethode extends Model
{
protected $fillable = [
'projekte_id',
'methode_id',
'geschoss',
'raumart',
'flaeche',
];
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');
}
}