Closed tviles closed 6 years ago
Hi, This change is now in dev-version, which breaks functionality for projects which do not use soft delete on user model. Add work around for those cases? Config?
/r Simple scope added to User model did the trick.. public function scopeWithtrashed($query) { return $query; }
The User relationship in the Messages model needs to have ->withTrashed() to allow messages to be viewed even if the user has been soft-deleted. Otherwise it throws an error.
Before: public function user() { return $this->belongsTo(config('talk.user.model', 'App\User')); }
After: public function user() { return $this->belongsTo(config('talk.user.model', 'App\User'))->withTrashed(); }