protected function buildRouteCollection(): RouteCollection
{
...
return Cache::remember(static::ROUTE_COLLECTION_CACHE_KEY, function () {
return $this->prepareRouteCollection();
}, $this->cacheConfig);
This fails with PHP type error if the cache contains for example false value. Probably should be something like this:
$cached = Cache::remember(static::ROUTE_COLLECTION_CACHE_KEY, function () {
return $this->prepareRouteCollection();
}, $this->cacheConfig);
if ($cached instance of RouteCollection) {
return $cached;
} else {
Cache::delete(static::ROUTE_COLLECTION_CACHE_KEY, $this->cacheConfig);
}