czim / laravel-modelcomparer Goto Github PK
View Code? Open in Web Editor NEWA tool for making change logs for Eloquent models and their relations
License: MIT License
A tool for making change logs for Eloquent models and their relations
License: MIT License
Laravel version: 5.2
Package version: 0.9
Got following error:
BadMethodCallException: Call to undefined method Illuminate\Database\Query\Builder::0() in /home/vagrant/code/weerman/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2405
Stack trace:
#0 [internal function]: Illuminate\Database\Query\Builder->__call('0', Array)
#1 /home/vagrant/code/weerman/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1426): call_user_func_array(Array, Array)
#2 [internal function]: Illuminate\Database\Eloquent\Builder->__call('0', Array)
#3 /home/vagrant/code/weerman/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(3526): call_user_func_array(Array, Array)
#4 /home/vagrant/code/weerman/vendor/cartalyst/sentinel/src/Users/EloquentUser.php(443): Illuminate\Database\Eloquent\Model->__call('0', Array)
#5 /home/vagrant/code/weerman/vendor/czim/laravel-modelcomparer/src/Comparer/Comparer.php(310): Cartalyst\Sentinel\Users\EloquentUser->__call('0', Array)
#6 /home/vagrant/code/weerman/vendor/czim/laravel-modelcomparer/src/Comparer/Comparer.php(357): Czim\ModelComparer\Comparer\Comparer->buildNormalizedArrayTree(Object(App\Models\User), 'user')
After some investigation figured out that the error is related to buildNormalizedArrayTree method. If model relations not loaded, then $model->getRelations() returns following:
array:2 [ 0 => "debtor" 1 => "scopeDebtor" ]
In this case, $relationKeys = array_keys($model->getRelations()); consists of 0 & 1 which is not a valid method names for model.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.