33 lines
615 B
PHP
33 lines
615 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');
|
|
}
|
|
}
|