Grundgerüst Formulare und Seeder
This commit is contained in:
@@ -4,16 +4,23 @@ namespace App\Models;
|
||||
|
||||
use App\HasDocuments;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
|
||||
class Contract extends Model
|
||||
{
|
||||
use HasDocuments;
|
||||
|
||||
protected $fillable = ['name', 'type'];
|
||||
protected $fillable = ['name', 'type', 'responsible_id', 'contractable_type', 'contractable_id'];
|
||||
|
||||
public function contractable()
|
||||
public function contractable(): MorphTo
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
public function responsible(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user