You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is my function. I am working with Laravel 8 and PHP 8
public function index(Request $request)
{
$request->user()->authorizeRoles(['user', 'admin']);
//retrieve visitors and pageview data for the current day and the last seven days
$dataDias = Analytics::fetchVisitorsAndPageViews(Period::days( 7 ));
// $dataAnio = Analytics::fetchVisitorsAndPageViews(Period::years(1));
$dataAnio = Analytics::fetchVisitorsAndPageViews(Period::months(6));
$userActive = Analytics::getAnalyticsService()->data_realtime->get('ga:'.env('ANALYTICS_VIEW_ID'), 'rt:activeVisitors')->totalsForAllResults['rt:activeVisitors'];
// dd($dataDias);
// dd($totalNow);
// dd($userActive);
return view('home', compact('dataDias', 'dataAnio', 'userActive'));
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is my function. I am working with Laravel 8 and PHP 8
public function index(Request $request)
{
$request->user()->authorizeRoles(['user', 'admin']);
Beta Was this translation helpful? Give feedback.
All reactions