start guest invitation on event

This commit is contained in:
2020-08-09 20:45:41 +02:00
parent fa6d769daa
commit ec837fdb0a
8 changed files with 194 additions and 0 deletions

View File

@@ -2,9 +2,18 @@
namespace App\Models;
use App\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Event extends Model
{
protected $guarded = [];
public function guests() :BelongsToMany
{
return $this->belongsToMany(User::class, 'event_guest')
->withPivot('is_staff', 'validated_at')
->withTimestamps();
}
}