rename tables raumealle, allgemeinflaechen orientierung_zu_abschlaege
This commit is contained in:
1 parent
f2b6487ec0
commit
92bdc77eee
31 files changed
+194
-197
No files matched your search
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProjektOrientierungZuAbschlaege extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'projekte_id',
|
||||
'orientierung_id',
|
||||
'nicht_in_orientierung',
|
||||
'top_nummer',
|
||||
'type',
|
||||
'raumart',
|
||||
'nutzwert',
|
||||
'a',
|
||||
'b',
|
||||
'c',
|
||||
'd',
|
||||
'e',
|
||||
'f',
|
||||
'g',
|
||||
'h',
|
||||
'i',
|
||||
'j',
|
||||
];
|
||||
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
self::updated(function ($model) {
|
||||
Projekte::where('id', $model['projekte_id'])->update([
|
||||
'evaluation_gutachten' => false,
|
||||
'pdf_nutzwerte_status' => false,
|
||||
'pdf_gutachten_status' => false,
|
||||
'excel_nutzwerte_status' => false,
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'nicht_in_orientierung' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function orientierung()
|
||||
{
|
||||
return $this->hasOne(Orientierung::class, 'id', 'orientierung_id');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user