public static function bootUserHasTeams() { static::deleting(function (Model $user) { if (!method_exists(Config::get('teamwork.user_model'), 'bootSoftDeletes')) { $user->teams()->sync([]); } return true; }); }