Merge branch 'develop' into trunk

This commit is contained in:
Vincent BRIDIER 2022-09-21 15:54:15 +02:00
commit f1c5c5ba41
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
2 changed files with 15 additions and 2 deletions

View file

@ -15,7 +15,20 @@ class LDCNetworksController extends Controller
*/
public function index()
{
// $networks = LDCNetwork::all();
// return \response()->json((new LDCNetworkResource($networks)));
$ips = [];
$networks = LDCNetwork::all();
return \response()->json((new LDCNetworkResource($networks)));
foreach ($networks as $network) {
$infos = explode('.', $network->first_ip);
$min = $infos[3];
$max = explode('.', $network->last_ip)[3];
for ($i = $min; $i <= $max; $i++) {
$ips[] = "$infos[0].$infos[1].$infos[2].$i";
}
}
return response($ips);
}
}

View file

@ -16,7 +16,7 @@ class ServiceAccountsController extends Controller
*/
public function index()
{
$service_accounts = ServiceAccount::all();
$service_accounts = ServiceAccount::all()->sortBy('name');
return view('service-accounts.index', compact('service_accounts'));
}