Files
Verde-Web/app/Providers/AppServiceProvider.php
admin 4eb2d14e52 feat(backend): complete Module 4 (household registration)
households + household_members tables. Resident endpoints to create one
household (auto-resolves barangay from GPS), upload proof of residency,
manage members. Admin endpoints to list/approve/reject. Approving fires
HouseholdVerified event with a placeholder listener; Module 7 replaces
the body with actual QR batch allocation. Approved households are
immutable to residents; resubmitting after rejection resets to pending.

84 feature tests passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 00:06:37 +08:00

37 lines
1.1 KiB
PHP

<?php
namespace App\Providers;
use App\Events\HouseholdVerified;
use App\Listeners\AllocateFreeQrCodesOnHouseholdVerified;
use App\Services\Sms\FakeSmsService;
use App\Services\Sms\LogSmsService;
use App\Services\Sms\SemaphoreSmsService;
use App\Services\Sms\SmsService;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function register(): void
{
$this->app->singleton(SmsService::class, function ($app) {
$driver = config('services.sms.driver', 'log');
return match ($driver) {
'semaphore' => new SemaphoreSmsService(
apiKey: (string) config('services.semaphore.api_key'),
senderName: (string) config('services.semaphore.sender_name', 'VERDE'),
),
'fake' => new FakeSmsService(),
default => new LogSmsService(),
};
});
}
public function boot(): void
{
Event::listen(HouseholdVerified::class, AllocateFreeQrCodesOnHouseholdVerified::class);
}
}