TenantAtlas/app/Providers/AppServiceProvider.php
ahmido d939d45bcf fix: improve assignment capture/restore and filter name handling (#8)
Resolves assignment filter names when Graph stores filter IDs at assignment root.
Tracks assignment fetch success/failure and shows clearer UI states for versions.
Adds scope tag fallback display in backup set items.
Restored versions now capture applied assignments consistently.

Co-authored-by: Ahmed Darrazi <ahmeddarrazi@adsmac.local>
Reviewed-on: #8
2025-12-28 13:59:12 +00:00

52 lines
1.4 KiB
PHP

<?php
namespace App\Providers;
use App\Services\Graph\GraphClientInterface;
use App\Services\Graph\MicrosoftGraphClient;
use App\Services\Graph\NullGraphClient;
use App\Services\Intune\CompliancePolicyNormalizer;
use App\Services\Intune\DeviceConfigurationPolicyNormalizer;
use App\Services\Intune\SettingsCatalogPolicyNormalizer;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
$this->app->singleton(GraphClientInterface::class, function ($app) {
$config = $app['config']->get('graph');
$hasCredentials = ! empty($config['client_id'])
&& ! empty($config['client_secret'])
&& ! empty($config['tenant_id']);
if (! empty($config['enabled']) && $hasCredentials) {
return $app->make(MicrosoftGraphClient::class);
}
return $app->make(NullGraphClient::class);
});
$this->app->tag(
[
CompliancePolicyNormalizer::class,
DeviceConfigurationPolicyNormalizer::class,
SettingsCatalogPolicyNormalizer::class,
],
'policy-type-normalizers'
);
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
}
}