'datetime', ]; public function send_user() { return $this->belongsTo(User::class, 'sender')->withDefault(['id' => 0, 'username' => 'System']); } public function receive_user() { return $this->belongsTo(User::class, 'receiver'); } public static function add(array $data): bool { clear_inbox_count_cache($data["receiver"]); return self::query()->insert($data); } }