芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/app/Models/Event.php
$mentionEvent * @property-read int|null $mention_event_count * @property-read \Illuminate\Database\Eloquent\Collection
$mentionUser * @property-read int|null $mention_user_count * @mixin \Eloquent */ class Event extends BaseModel { use HasFactory, HasCompany; protected $casts = [ 'start_date_time' => 'datetime', 'end_date_time' => 'datetime', ]; protected $fillable = ['start_date_time', 'end_date_time', 'event_name', 'where', 'description']; public function attendee(): HasMany { return $this->hasMany(EventAttendee::class, 'event_id'); } public function getUsers() { $userArray = []; foreach ($this->attendee as $attendee) { array_push($userArray, $attendee->user()->select('id', 'email', 'name', 'email_notifications')->first()); } return collect($userArray); } public function files() { return $this->hasMany(EventFile::class, 'event_id')->orderBy('id', 'desc'); } public function mentionUser(): BelongsToMany { return $this->belongsToMany(User::class, 'mention_users')->withoutGlobalScope(ActiveScope::class)->using(MentionUser::class); } public function mentionEvent(): HasMany { return $this->hasMany(MentionUser::class, 'event_id'); } }