added invitations
linter / quality (push) Failing after 1m8s
tests / ci (8.3) (push) Failing after 48s
tests / ci (8.4) (push) Failing after 1m6s
tests / ci (8.5) (push) Failing after 1m4s

This commit is contained in:
Daan Meijer
2026-06-16 16:29:17 +02:00
parent 5404b1a535
commit 06cd53fe91
12 changed files with 509 additions and 7 deletions
+5
View File
@@ -29,6 +29,11 @@ class Dynamic extends Model
return $this->hasMany(Ledger::class);
}
public function invitations(): HasMany
{
return $this->hasMany(DynamicInvitation::class);
}
public function chat(): MorphOne
{
return $this->morphOne(Chat::class, 'chatable');
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class DynamicInvitation extends Model {
use HasFactory;
protected $fillable = [
'dynamic_id',
'email',
'role',
'token',
'expires_at',
];
protected $casts = [
'expires_at' => 'datetime',
];
public function dynamic(): BelongsTo {
return $this->belongsTo(Dynamic::class);
}
public function isExpired(): bool {
return $this->expires_at->isPast();
}
}