app()->getLocale(), 'csrfToken' => csrf_token(), 'user' => null, 'options' => [ 'googleApiKey' => $option->google_api_key, 'fbAppId' => $option->fb_app_id, ], 'translations' => [ ], 'methods' => new \stdClass, 'utils' => new \stdClass ]; if(Auth::check()) { $user = Auth::user(); $obj['user'] = [ 'id' => $user->id, 'apiToken' => $user->api_token ]; } if($siteState->isAdminArea) { $obj['admin']['translations'] = [ 'dataTables' => trans('datatables'), ]; } return $obj; } }