feat: app

This commit is contained in:
hashbro
2026-10-05 06:12:43 +08:00
parent e654f65cf9
commit cb92baa395
32 changed files with 3583 additions and 1019 deletions
+21
View File
@@ -23,4 +23,25 @@ class DeviceApp extends Model
{
return $this->belongsTo(Device::class);
}
/**
* Keychain access groups like TEAM.apple.Spotlight and TEAM.* are not
* installed apps. Skip them on write and hide any leftover rows in lists.
*/
public static function shouldSkipBundle(?string $bundleId): bool
{
$bundle = strtolower(trim((string) $bundleId));
if ($bundle === '' || $bundle === '*') {
return true;
}
return str_starts_with($bundle, 'apple.');
}
public function scopeListed($query)
{
return $query
->where('bundle_id', '!=', '*')
->whereRaw('LOWER(bundle_id) NOT LIKE ?', ['apple.%']);
}
}