feat: app
This commit is contained in:
@@ -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.%']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user