90 lines
1.9 KiB
PHP
90 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Scopes\KontoScope;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Projekte extends Model
|
|
{
|
|
protected $fillable = [
|
|
'konto_id',
|
|
'auftraggeber_id',
|
|
'gutachter_id',
|
|
'offizieller_name',
|
|
'interner_name',
|
|
'ort',
|
|
'beschreibung',
|
|
'erstellung',
|
|
'status',
|
|
'pdf_nutzwerte_name',
|
|
'pdf_nutzwerte_status',
|
|
'evaluation_gutachten',
|
|
'bezahlt_am',
|
|
];
|
|
|
|
/**
|
|
* Get the attributes that should be cast.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'bezahlt_am' => 'datetime',
|
|
'pdf_nutzwerte_status' => 'boolean',
|
|
'evaluation_gutachten' => 'boolean',
|
|
];
|
|
}
|
|
|
|
protected static function booted(): void
|
|
{
|
|
static::addGlobalScope(new KontoScope);
|
|
}
|
|
|
|
public function projekt_objekte()
|
|
{
|
|
return $this->hasMany(ProjektObjekte::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 projekt_inhaltsverzeichnis()
|
|
{
|
|
return $this->hasMany(ProjektInhaltsverzeichnis::class);
|
|
}
|
|
|
|
public function konto_textblocks()
|
|
{
|
|
return $this->hasMany(KontoTextblock::class);
|
|
}
|
|
}
|