prepareRender(); return view('article', $this->viewData); } /** * Return a boolean value indicating if this creator in particular can * create bundles for specified section */ public static function handles(Bundle $bundle): bool { return $bundle->getPath() === '/dossiers/'; } protected function collectSubBundles() { $subBundles = Bundle::findBundles($this->bundle->getDisk(), $this->bundle->getPath()); $subBundles = collect($subBundles) ->filter(fn (Bundle $bundle) => !empty($bundle->metadata()->get('date')) && $bundle->getPath() !== $this->bundle->getPath()) ->sort(function (Bundle $bundleA, Bundle $bundleB) { return Carbon::parse($bundleA->metadata()->get('date'))->lt(Carbon::parse($bundleB->metadata()->get('date'))); }) ->map(fn (Bundle $bundle) => $bundle->getPath()) ->toArray(); return $subBundles; } }