ein paar models und migrateions

This commit is contained in:
2026-02-08 14:06:08 +00:00
parent fca99107ae
commit fc6aee5760
6 changed files with 97 additions and 5 deletions

10
app/Models/Contract.php Normal file
View File

@@ -0,0 +1,10 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Contract extends Model
{
//
}

16
app/Models/Document.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Document extends Model
{
protected $fillable = ['name'];
public function documentable()
{
return $this->morphTo();
}
}

View File

@@ -3,6 +3,8 @@
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use App\Models\Document;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
@@ -45,4 +47,9 @@ class User extends Authenticatable
'password' => 'hashed',
];
}
public function documents()
{
return $this->morphMany(Document::class, 'documentable');
}
}