projekt wip bofore relations

This commit is contained in:
salam committed 2025-10-03 10:55:01 +02:00
1 parent aa301f1197
commit 69d4efcd9d
11 files changed
+80 -89

No files matched your search

+6
View File
@@ -2,6 +2,7 @@
namespace App\Models;
use App\Models\Scopes\KontoScope;
use Database\Factories\AuftraggeberFactory;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@@ -36,6 +37,11 @@ class Auftraggeber extends Model
];
}
protected static function booted(): void
{
static::addGlobalScope(new KontoScope);
}
protected static function newFactory(): Factory
{
return AuftraggeberFactory::new();
-29
View File
@@ -1,29 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Projekt extends Model
{
protected $fillable = [
'konto_id',
'auftraggeber_id',
'gutachter_id',
'gutachter_id',
'ofizieller_name',
'beschreibung',
'erstellung',
'status',
];
public function auftraggeber()
{
return $this->belongsTo(Auftraggeber::class);
}
public function gutachter()
{
return $this->belongsTo(Gutachter::class);
}
}
+11
View File
@@ -6,6 +6,17 @@ use Illuminate\Database\Eloquent\Model;
class Projekte extends Model
{
protected $fillable = [
'konto_id',
'auftraggeber_id',
'gutachter_id',
'offizieller_name',
'interner_name',
'beschreibung',
'erstellung',
'status',
];
public function auftraggeber()
{
return $this->belongsTo(Auftraggeber::class);