Files
2026-09-17 08:35:36 +02:00

133 lines
3.0 KiB
PHP

<?php
namespace App\Models;
use App\Models\Scopes\KontoScope;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property int $cloned_from_id
* @property int $konto_id
* @property int $auftraggeber_id
* @property string $interner_name
* @property string $offizieller_name
* @property string $ort
* @property string $beschreibung
* @property string $erstellung
* @property string $status
* @property int $projekt_farben_verwenden
* @property string $deckblatt_bg
* @property string $schmuckfarbe_header
* @property string $farbe_borders
* @property int $evaluation_gutachten
* @property int $pdf_nutzwerte_tabellen_umbruch
*/
class Projekte extends Model
{
protected $primaryKey = 'id';
protected $fillable = [
'id',
'cloned_from_id',
'konto_id',
'auftraggeber_id',
'gutachter_id',
'interner_name',
'offizieller_name',
'ort',
'beschreibung',
'erstellung',
'status',
'projekt_farben_verwenden',
'deckblatt_bg',
'schmuckfarbe_header',
'farbe_borders',
'evaluation_gutachten',
'pdf_nutzwerte_tabellen_umbruch',
'bezahlt_am',
'created_at',
'updated_at',
'deleted_at',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'bezahlt_am' => 'datetime',
'evaluation_gutachten' => 'boolean',
'projekt_farben_verwenden' => 'boolean',
];
}
public function projekt_users()
{
return $this->belongsToMany(Projekte::class, 'projekt_users', 'projekte_id', 'user_id');
}
protected static function booted(): void
{
static::addGlobalScope(new KontoScope);
}
public function projekt_objekte()
{
return $this->hasMany(ProjektObjekte::class);
}
public function projekt_merkmale()
{
return $this->hasMany(ProjektMerkmale::class);
}
public function auftraggeber()
{
return $this->belongsTo(Auftraggeber::class);
}
public function projekt_platzhalters()
{
return $this->hasMany(ProjektPlatzhalter::class);
}
public function gutachter()
{
return $this->belongsTo(Gutachter::class);
}
public function projekt_allgemeinflaechens()
{
return $this->hasMany(ProjektAllgemeinflaechen::class);
}
public function projekt_raeumealles()
{
return $this->hasMany(ProjektObjekteImDetail::class);
}
public function projekt_methodes()
{
return $this->hasMany(ProjektMethode::class);
}
public function file_imports()
{
return $this->hasMany(FileImport::class);
}
public function projekt_inhaltsverzeichnis()
{
return $this->hasMany(ProjektInhaltsverzeichnis::class);
}
public function konto_textblocks()
{
return $this->hasMany(KontoTextblock::class);
}
}