Comments (4)
OK, then I misunderstood how it's supposed to work (basically old/new becomes removed/added). I think what confused me was this line in the docs:
The audited value is the array version of the relationship return!
Could be rephrased or extended.
Thanks for the quick response. Closing this issue. I've also changed the title hoping it will be easier to discover by anyone having the same problem.
from laravel-auditing.
from laravel-auditing.
- Sync, removing A and adding D
I think the problem is here, using sync to append relations is tricky because as pointed out sync will reset the whole relationship.
You would have to do something like
$categories = $model->categories;
// remove D from categories
$categories->push($A);
$model->auditSync('categories', $categories);
from laravel-auditing.
Could be rephrased or extended.
I think so, you can open a PR to make it more understandable, English is not my language
from laravel-auditing.
Related Issues (20)
- ErrorException: Undefined array key "table" in /vendor/laravel/framework/src/Illuminate/Queue/Connectors/DatabaseConnector.php:38 HOT 1
- Binary attribute casting no longer works in new versions (works flawlessly with v13.5.1) HOT 5
- Duplicate entries for every action HOT 8
- Values are not being audited when using DB::beginTransaction HOT 2
- Implement support for Laravel 11.x. HOT 1
- Column with type `point` throws error HOT 1
- SoftDelete behaviour config option true/false HOT 5
- Laravel 11 HOT 1
- Error when implementing transformAudit HOT 2
- UUID user_type and user_id store error HOT 3
- Empty array values when auditing relations HOT 3
- Unknown column 'auditEvents' in 'field list'
- AuditingEventServiceProvider disables Laravel's Event Auto-Discovery HOT 2
- Laravel Audit breaks Events Auto Discovery HOT 1
- Laravel's auto event discovery not working HOT 1
- Accessing static trait property OwenIt\Auditing\Audit::$auditingDisabled is deprecated HOT 2
- Auditing for each relationship being saved more than once in multiple relationship auditing with auditSync
- Prepared statement contains too many placeholders HOT 10
- Audited logs deleted on fresh install with threshold set to > 0 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-auditing.