mikebronner / laravel-pivot-events

MIT License
119 stars 8 forks source link

Extend changes for sync event #10

Closed DashaRozhniatovska closed 1 year ago

DashaRozhniatovska commented 1 year ago

Hello!

I'd like to ask you could you please extend changes array for sync events like in the attached event (with additional attributes info) Now it looks like this:

[
   "attached" => [
     0 => 3
   ]
   "detached" => [
     1 => 2
   ]
   "updated" => [
     0 => 1
   ]
 ]

Extend changes array:

[
   "attached" => [
     1 => ['attribute' => '', 'attribute2' => ''], 
     2 => ['attribute' => 'test', 'attribute2' => 'test2']
   ],
   "detached" => [4, 5],
   "updated" => [
     3 => ['attribute' => 'test3', 'attribute2' => 'test4']
   ],
 ]