laracasts / PHP-Vars-To-Js-Transformer

Transform PHP data to JavaScript.
https://packagist.org/packages/laracasts/utilities
MIT License
2.21k stars 219 forks source link

Failed calling Illuminate\Database\Eloquent\Collection::jsonSerialize() #96

Closed raomingchao closed 7 years ago

raomingchao commented 7 years ago

Exception in PHPToJavaScriptTransformer.php line 207: Failed calling Illuminate\Database\Eloquent\Collection::jsonSerialize() in PHPToJavaScriptTransformer.php line 207 at json_encode() in PHPToJavaScriptTransformer.php line 0 at PHPToJavaScriptTransformer->transformObject(object(Collection)) in PHPToJavaScriptTransformer.php line 135 at PHPToJavaScriptTransformer->optimizeValueForJavaScript(object(Collection)) in PHPToJavaScriptTransformer.php line 119 at PHPToJavaScriptTransformer->buildVariableInitialization('models', object(Collection)) in PHPToJavaScriptTransformer.php line 90 at PHPToJavaScriptTransformer->buildJavaScriptSyntax(array('models' => object(Collection))) in PHPToJavaScriptTransformer.php line 69 at PHPToJavaScriptTransformer->put('models', object(Collection)) in AdminController.php line 25 at AdminController->index() at call_user_func_array(array(object(AdminController), 'index'), array()) in Controller.php line 80 at Controller->callAction('index', array()) in ControllerDispatcher.php line 146 at ControllerDispatcher->call(object(AdminController), object(Route), 'index') in ControllerDispatcher.php line 94 at ControllerDispatcher->Illuminate\Routing{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52 at Pipeline->Illuminate\Routing{closure}(object(Request)) in UserPrefs.php line 26 at UserPrefs->handle(object(Request), object(Closure)) at call_user_func_array(array(object(UserPrefs), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing{closure}(object(Request)) in JavaScriptData.php line 39 at JavaScriptData->handle(object(Request), object(Closure)) at call_user_func_array(array(object(JavaScriptData), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing{closure}(object(Request)) in AdminLocale.php line 38 at AdminLocale->handle(object(Request), object(Closure)) at call_user_func_array(array(object(AdminLocale), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing{closure}(object(Request)) in Authorization.php line 25 at Authorization->handle(object(Request), object(Closure)) at call_user_func_array(array(object(Authorization), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing{closure}(object(Request)) in Authenticate.php line 29 at Authenticate->handle(object(Request), object(Closure)) at call_user_func_array(array(object(Authenticate), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) ....