Change behavior with Part::fill() to fill according the fillables order, instead of the attributes which might have random key order, so no longer need to override the fill() method. The main point here is to not fill the repository attributes before other attributes have been filled, notice they are placed at bottom of the fillables array.
Clean up old items from repository for: $channel->permission_overwrites, $guild->roles, $guild->emojis, $guild->stickers, and $message->reactions. While the items are replaced with new one, old items are unset from memory, but not from the cache, this PR fixes that.
$repository->discrim
getter$repositiory->keys()
to return item keys (reference: https://laravel.com/api/5.5/Illuminate/Support/Collection.html#method_keys note: I'm not adding this to Collection since that originally designed to return a Collection instead of just the keys array)Part::fill()
to fill according thefillables
order, instead of theattributes
which might have random key order, so no longer need to override thefill()
method. The main point here is to not fill the repository attributes before other attributes have been filled, notice they are placed at bottom of the fillables array.$channel->permission_overwrites
,$guild->roles
,$guild->emojis
,$guild->stickers
, and$message->reactions
. While the items are replaced with new one, old items are unset from memory, but not from the cache, this PR fixes that.Partially tested.