-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to auditrail Delete with composite key #456
Comments
Can you provide the error, or do I have to guess? |
current error: array_key_exists(): The first argument should be either a string or an integer |
Dude, seriously... |
|
is that enough? |
The Duplicate of #416. |
|
Yes, it does. Same issue, though. |
why are you saying lack of information? what kind of information you need? |
Because that's what #416 lacks?
Like in the other issue I mentioned, this seems to be some kind of eloquent extension (that you also didn't bother to mention, btw). Because this doesn't seem to be in high demand (so far, only two people have complained), I won't waste more of my time.
Feel free to investigate the issue and continue commenting if you like. If you find a solution do a pull request and we'll review it. |
should not be closed in the first place. |
I checked, now what?
If it's not using a composite key like you do, why do you think it's even related? You're on version 6.x of the package, that conversation was about 3.x. A lot has changed since then.
And how the fuck should I know? You haven't even told us what package you're using for the composite key feature, because as far as I know, Eloquent doesn't support that. If you still want help, you have one last try to provide valuable information. If you come up with another answer like the previous ones, I will cease trying to help. |
nvm i solve it on my own. |
Hi @caranzojason, I found a workaround to audit composite key model with this package, if you're still interested, contact me [email protected] |
Hello everyone, I'm having also issues with composite keys. I'm using this Trait to get Laravel working with composite keys. But now as soon as I implement the Auditable interface and try to fetch data of a composite key model, it throws an I debugged for a long time but I can't find the reason why the Here is the complete error stack:
|
Actual Behaviour
I want to audit if i delete the model with composite key
in Model:
protected $primaryKey = ['roleID', 'menuPermissionID'];
public $incrementing = false;
using model:
$result = $this->model->where('roleID',$roleId)->
where('menuPermissionID',$menuPermissionID)>firstOrFail();
$result->delete();
Expected Behaviour
it should delete and save to audit trail.
right now there is an error during delete.
however if i used this query
$this->model->where('roleID',$roleId)->delete();
it will delete but it won't audit trail.
current error: array_key_exists(): The first argument should be either a string or an integer
The text was updated successfully, but these errors were encountered: