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
Well, a brute force way would be to check the database and see if it's MongoDB and branch accordingly. Or, if that's too specific to MongoDB, you can add a user set variable $includeTableNameInColumn. For the first issue, I think -> is technically incorrect and works only by accident (the Eloquent method that your newFromBuilder overrides takes an array as param 1, not an object ). https://laravel.com/api/5.2/Illuminate/Database/Eloquent/Model.html#method_newFromBuilder
Closing out a long ago asked question. I don't have time to investigate what it takes to support Mongo. A PR with test cases would be happily accepted provided they maintain existing support.
hi
I just found this library when i was trying to implement something similar. Great stuff, thanks.
In fact, I am new to laravel and eloquent.
As I am using mongodb , i also found this mongodb version eloquent https://github.com/jenssegers/laravel-mongodb
However, when I try to use SingleTableInheritanceTrait to that 'Moloquent' I have to make two changes in order to make it work:
1.at line 171 of SingleTableInheritanceTrait.php
$classType = isset($attributes->$typeField) ? $attributes->$typeField : null;
to
$classType = isset($attributes[$typeField]) ? $attributes[$typeField] : null;
this one i guess is something related to 'mongo' as it will return pure array, i didn't have time to check with 'mysql'
2.at line 195 of SingleTableInheritanceTrait.php
return $this->getTable() . '.' . static::$singleTableTypeField;
to
return static::$singleTableTypeField;
same thing here as the query column key needs to be the field name itself without 'table' name
Any thought about this?
The text was updated successfully, but these errors were encountered: