Updated array() usages to be []
This commit is contained in:
parent
8a6748f1b0
commit
f488e10c2f
|
@ -264,7 +264,7 @@ class ApiController extends Controller
|
||||||
|
|
||||||
protected function storeServer(Request $request)
|
protected function storeServer(Request $request)
|
||||||
{
|
{
|
||||||
$rules = array(
|
$rules = [
|
||||||
'hostname' => 'min:3',
|
'hostname' => 'min:3',
|
||||||
'server_type' => 'required|integer',
|
'server_type' => 'required|integer',
|
||||||
'os_id' => 'required|integer',
|
'os_id' => 'required|integer',
|
||||||
|
@ -289,9 +289,9 @@ class ApiController extends Controller
|
||||||
'price' => 'required|numeric',
|
'price' => 'required|numeric',
|
||||||
'payment_term' => 'required|integer',
|
'payment_term' => 'required|integer',
|
||||||
'next_due_date' => 'date',
|
'next_due_date' => 'date',
|
||||||
);
|
];
|
||||||
|
|
||||||
$messages = array(
|
$messages = [
|
||||||
'required' => ':attribute is required',
|
'required' => ':attribute is required',
|
||||||
'min' => ':attribute must be longer than 3',
|
'min' => ':attribute must be longer than 3',
|
||||||
'integer' => ':attribute must be an integer',
|
'integer' => ':attribute must be an integer',
|
||||||
|
@ -300,7 +300,7 @@ class ApiController extends Controller
|
||||||
'numeric' => ':attribute must be a float',
|
'numeric' => ':attribute must be a float',
|
||||||
'ip' => ':attribute must be a valid IP address',
|
'ip' => ':attribute must be a valid IP address',
|
||||||
'date' => ':attribute must be a date Y-m-d',
|
'date' => ':attribute must be a date Y-m-d',
|
||||||
);
|
];
|
||||||
|
|
||||||
$validator = Validator::make($request->all(), $rules, $messages);
|
$validator = Validator::make($request->all(), $rules, $messages);
|
||||||
|
|
||||||
|
@ -375,7 +375,7 @@ class ApiController extends Controller
|
||||||
|
|
||||||
public function updateServer(Request $request)
|
public function updateServer(Request $request)
|
||||||
{
|
{
|
||||||
$rules = array(
|
$rules = [
|
||||||
'hostname' => 'string|min:3',
|
'hostname' => 'string|min:3',
|
||||||
'server_type' => 'integer',
|
'server_type' => 'integer',
|
||||||
'os_id' => 'integer',
|
'os_id' => 'integer',
|
||||||
|
@ -398,9 +398,9 @@ class ApiController extends Controller
|
||||||
'price' => 'numeric',
|
'price' => 'numeric',
|
||||||
'payment_term' => 'integer',
|
'payment_term' => 'integer',
|
||||||
'next_due_date' => 'date',
|
'next_due_date' => 'date',
|
||||||
);
|
];
|
||||||
|
|
||||||
$messages = array(
|
$messages = [
|
||||||
'required' => ':attribute is required',
|
'required' => ':attribute is required',
|
||||||
'min' => ':attribute must be longer than 3',
|
'min' => ':attribute must be longer than 3',
|
||||||
'integer' => ':attribute must be an integer',
|
'integer' => ':attribute must be an integer',
|
||||||
|
@ -408,7 +408,7 @@ class ApiController extends Controller
|
||||||
'size' => ':attribute must be exactly :size characters',
|
'size' => ':attribute must be exactly :size characters',
|
||||||
'numeric' => ':attribute must be a float',
|
'numeric' => ':attribute must be a float',
|
||||||
'date' => ':attribute must be a date Y-m-d',
|
'date' => ':attribute must be a date Y-m-d',
|
||||||
);
|
];
|
||||||
|
|
||||||
$validator = Validator::make($request->all(), $rules, $messages);
|
$validator = Validator::make($request->all(), $rules, $messages);
|
||||||
|
|
||||||
|
@ -430,22 +430,22 @@ class ApiController extends Controller
|
||||||
|
|
||||||
public function updatePricing(Request $request)
|
public function updatePricing(Request $request)
|
||||||
{
|
{
|
||||||
$rules = array(
|
$rules = [
|
||||||
'price' => 'required|numeric',
|
'price' => 'required|numeric',
|
||||||
'currency' => 'required|string|size:3',
|
'currency' => 'required|string|size:3',
|
||||||
'term' => 'required|integer',
|
'term' => 'required|integer',
|
||||||
'active' => 'integer',
|
'active' => 'integer',
|
||||||
'next_due_date' => 'date',
|
'next_due_date' => 'date',
|
||||||
);
|
];
|
||||||
|
|
||||||
$messages = array(
|
$messages = [
|
||||||
'required' => ':attribute is required',
|
'required' => ':attribute is required',
|
||||||
'integer' => ':attribute must be an integer',
|
'integer' => ':attribute must be an integer',
|
||||||
'string' => ':attribute must be a string',
|
'string' => ':attribute must be a string',
|
||||||
'size' => ':attribute must be exactly :size characters',
|
'size' => ':attribute must be exactly :size characters',
|
||||||
'numeric' => ':attribute must be a float',
|
'numeric' => ':attribute must be a float',
|
||||||
'date' => ':attribute must be a date Y-m-d',
|
'date' => ':attribute must be a date Y-m-d',
|
||||||
);
|
];
|
||||||
|
|
||||||
$validator = Validator::make($request->all(), $rules, $messages);
|
$validator = Validator::make($request->all(), $rules, $messages);
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ class HomeController extends Controller
|
||||||
|
|
||||||
$p->stopTimer();
|
$p->stopTimer();
|
||||||
|
|
||||||
$information = array(
|
$information = [
|
||||||
'servers' => $service_count['servers'],
|
'servers' => $service_count['servers'],
|
||||||
'domains' => $service_count['domains'],
|
'domains' => $service_count['domains'],
|
||||||
'shared' => $service_count['shared'],
|
'shared' => $service_count['shared'],
|
||||||
|
@ -67,7 +67,7 @@ class HomeController extends Controller
|
||||||
'execution_time' => number_format($p->getTimeTaken(), 2),
|
'execution_time' => number_format($p->getTimeTaken(), 2),
|
||||||
'servers_summary' => $server_summary,
|
'servers_summary' => $server_summary,
|
||||||
'currency' => Session::get('dashboard_currency')
|
'currency' => Session::get('dashboard_currency')
|
||||||
);
|
];
|
||||||
|
|
||||||
return view('home', compact('information'));
|
return view('home', compact('information'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,20 +58,20 @@ class Yabs extends Model
|
||||||
{
|
{
|
||||||
$speed_tests = [];
|
$speed_tests = [];
|
||||||
foreach ($data->network_speed as $ns) {
|
foreach ($data->network_speed as $ns) {
|
||||||
$speed_tests[] = array(
|
$speed_tests[] = [
|
||||||
'location' => $ns->location,
|
'location' => $ns->location,
|
||||||
'send' => $ns->send . ' ' . $ns->send_type,
|
'send' => $ns->send . ' ' . $ns->send_type,
|
||||||
'receive' => $ns->receive . ' ' . $ns->receive_type,
|
'receive' => $ns->receive . ' ' . $ns->receive_type,
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
return array(
|
return [
|
||||||
'date_time' => $data->output_date,
|
'date_time' => $data->output_date,
|
||||||
'location' => $data->server->location->name,
|
'location' => $data->server->location->name,
|
||||||
'provider' => $data->server->provider->name,
|
'provider' => $data->server->provider->name,
|
||||||
'uptime' => $data->uptime,
|
'uptime' => $data->uptime,
|
||||||
'distro' => $data->distro,
|
'distro' => $data->distro,
|
||||||
'kernel' => $data->kernel,
|
'kernel' => $data->kernel,
|
||||||
'cpu' => array(
|
'cpu' => [
|
||||||
'cores' => $data->cpu_cores,
|
'cores' => $data->cpu_cores,
|
||||||
'speed_mhz' => $data->cpu_freq,
|
'speed_mhz' => $data->cpu_freq,
|
||||||
'model' => $data->cpu_model,
|
'model' => $data->cpu_model,
|
||||||
|
@ -79,30 +79,30 @@ class Yabs extends Model
|
||||||
'vm' => $data->vm === 1,
|
'vm' => $data->vm === 1,
|
||||||
'GB5_single' => $data->gb5_single,
|
'GB5_single' => $data->gb5_single,
|
||||||
'GB5_multi' => $data->gb5_multi,
|
'GB5_multi' => $data->gb5_multi,
|
||||||
),
|
],
|
||||||
'ram' => array(
|
'ram' => [
|
||||||
'amount' => $data->ram . ' ' . $data->ram_type,
|
'amount' => $data->ram . ' ' . $data->ram_type,
|
||||||
'mb' => $data->ram_mb,
|
'mb' => $data->ram_mb,
|
||||||
'swap' => array(
|
'swap' => [
|
||||||
'amount' => $data->swap ?? null . ' ' . $data->swap_type ?? null,
|
'amount' => $data->swap ?? null . ' ' . $data->swap_type ?? null,
|
||||||
'mb' => $data->swap_mb ?? null,
|
'mb' => $data->swap_mb ?? null,
|
||||||
),
|
],
|
||||||
),
|
],
|
||||||
'disk' => array(
|
'disk' => [
|
||||||
'amount' => $data->disk . ' ' . $data->disk_type,
|
'amount' => $data->disk . ' ' . $data->disk_type,
|
||||||
'gb' => $data->disk_gb,
|
'gb' => $data->disk_gb,
|
||||||
'speed_tests' => array(
|
'speed_tests' => [
|
||||||
'4k' => $data->disk_speed->d_4k . ' ' . $data->disk_speed->d_4k_type,
|
'4k' => $data->disk_speed->d_4k . ' ' . $data->disk_speed->d_4k_type,
|
||||||
'64k' => $data->disk_speed->d_64k . ' ' . $data->disk_speed->d_64k_type,
|
'64k' => $data->disk_speed->d_64k . ' ' . $data->disk_speed->d_64k_type,
|
||||||
'512k' => $data->disk_speed->d_512k . ' ' . $data->disk_speed->d_512k_type,
|
'512k' => $data->disk_speed->d_512k . ' ' . $data->disk_speed->d_512k_type,
|
||||||
'1m' => $data->disk_speed->d_1m . ' ' . $data->disk_speed->d_1m_type,
|
'1m' => $data->disk_speed->d_1m . ' ' . $data->disk_speed->d_1m_type,
|
||||||
),
|
],
|
||||||
),
|
],
|
||||||
'network' => array(
|
'network' => [
|
||||||
'has_ipv6' => $data->has_ipv6 === 1,
|
'has_ipv6' => $data->has_ipv6 === 1,
|
||||||
'speed_tests' => $speed_tests
|
'speed_tests' => $speed_tests
|
||||||
),
|
],
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function speedAsMbps(string $string): float
|
public static function speedAsMbps(string $string): float
|
||||||
|
|
Loading…
Reference in New Issue
Block a user