added "members" for an event that help the admins to moderate. members must be invited via email.
This commit is contained in:
57
app/Models/EventMember.php
Normal file
57
app/Models/EventMember.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/** @property array<string,mixed>|null $permissions */
|
||||
class EventMember extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\EventMemberFactory> */
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'tenant_id',
|
||||
'event_id',
|
||||
'user_id',
|
||||
'invited_by',
|
||||
'name',
|
||||
'email',
|
||||
'role',
|
||||
'status',
|
||||
'invite_token',
|
||||
'invited_at',
|
||||
'joined_at',
|
||||
'last_activity_at',
|
||||
'permissions',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'invited_at' => 'datetime',
|
||||
'joined_at' => 'datetime',
|
||||
'last_activity_at' => 'datetime',
|
||||
'permissions' => 'array',
|
||||
];
|
||||
|
||||
public function tenant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Tenant::class);
|
||||
}
|
||||
|
||||
public function event(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Event::class);
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function invitedBy(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'invited_by');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user