abraham foto abraham foto - 1 year ago 79
PHP Question

Google page speed returning object rather than the speed

this is my controller.i am trying to integrate the google page speed to my laravel project.

class TestController extends Controller
public function pagespeed()
$pageSpeed = new \PageSpeed\Insights\Service();
$pagespeed = $pageSpeed->getResults('http://www.thesecretlab.nl');
return $pagespeed;

the output is a whole array.I wanted to get the speed value?

Answer Source

You could replace:

return $pagespeed;


return $pagespeed['ruleGroups']['SPEED']['score'];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download