DONE: feature flags by branches

This commit is contained in:
ISMAIL MASSERAN
2026-09-08 14:48:13 +08:00
parent f58a0cf702
commit 22279af86c
9 changed files with 298 additions and 2 deletions
+10 -1
View File
@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Cawangan;
use App\Feature;
use Illuminate\Http\Request;
class CawanganController extends Controller
@@ -18,7 +19,15 @@ class CawanganController extends Controller
$cawangan = Cawangan::on('mysql7')
->where('kodcaw','=',$code_cawangan)
->first();
return response()->json($cawangan);
if (!$cawangan) {
return response()->json($cawangan);
}
$data = $cawangan->toArray();
$data['features'] = Feature::mapFor($code_cawangan);
return response()->json($data);
}
public function create(Request $request)