Open DavidPhilip opened 9 years ago
David,
Apologies for the confusion--the sync will actually not be processed in this case (if you see an HTTP request please advise otherwise), however the model checks are run regardless in the __call overloaded method...
As for the error, it is expected that your model will inherit from Eloquent or otherwise include a getPrimaryKey()
method that returns a Firebase-compatible key. Alternatively (if not present) it will fall back to check for common variants (id, _id, $id).
If none of these defaults meet your use case (perhaps since you seem to be using pivot tables), could you provide more context for what you're trying to achieve?
I think the issue is the call of ->save()
as that seems to be the hook where the checks are fired for this plugin regardless of what I've declared in my settings as you already mentioned.
I used ->pivot
to change the values of the model in the pivot table and saved those changes by calling ->save()
. I ended up setting the values while attaching the relationship like so:
$club->attach([$member_ids], ['confirmed' => true, 'admin' => true])
In that case I don't call ->save()
and it works. So laravel-firebase kinda forces me to use that syntax or else it throws the aforementioned error. I will debug this at home and have a look at what kind of object the checks are run on. Maybe we can fix this by making an exception for some sort of type.
In my case I'm calling this:
resulting in this error:
I'm not sure how to handle this error.
Also there seems to be another issue:
$member
is of model-typeUser
where$firebase = false;
and alsosync => false
in the settings. Nevertheless there is the attempt to sync the model...Please tell if you need more info. Regards, David