Add config to specify which cawangan are enabled to use MyKad reader

This commit is contained in:
afiq.hamzah
2023-02-28 15:19:57 +08:00
parent 6f05fc9874
commit bc87fd8600
4 changed files with 34 additions and 4 deletions
+4 -3
View File
@@ -1,8 +1,9 @@
<?php
$default_port = '8085';
$getScannerEndpoint = fn($x) => 'http://localhost:' . $x . '/?MYKADJSON';
$getReaderEndpoint = fn($x) => 'http://localhost:' . $x . '/?MYKADJSON';
return[
'endpoint' => env('MYKAD_SCANNER_endpoint', $getScannerEndpoint(env('MYKAD_SCANNER_PORT', $default_port))),
];
'endpoint' => env('MYKAD_READER_ENDPOINT', $getReaderEndpoint(env('MYKAD_READER_PORT', $default_port))),
'enabled_cawangan' => array_map(fn ($cawangan) => trim($cawangan), explode(',', env('MYKAD_READER_ENABLED_CAWANGAN'))) ?? [],
];