/** * Registers the view paths by creating a new array and injecting a new FileViewFinder * * @param Factory $view * @param FileViewFinder $finder * @param TenantParticipant $tenant * * @return array */ protected function registerPathsInFinder(Factory $view, FileViewFinder $finder, TenantParticipant $tenant) { $paths = []; $this->addPathToViewPaths($paths, $tenant->getDomain()); $this->addPathToViewPaths($paths, $tenant->getTenantOwner()->getDomain()); $paths = array_merge($paths, $finder->getPaths()); $finder = $this->createViewFinder($finder, $paths); // replace ViewFinder in ViewManager with new instance with ordered paths $view->setFinder($finder); return $paths; }
/** * Copy a FileViewFinder to a FallbackFileViewFinder * * @param \Illuminate\View\FileViewFinder $otherFinder * @return static **/ public static function fromOther(FileViewFinder $otherFinder) { $copy = new static($otherFinder->getFilesystem(), $otherFinder->getPaths(), $otherFinder->getExtensions()); if ($otherFinder instanceof FallbackFileViewFinder) { $copy->setFallbackDir($otherFinder->getFallbackDir()); } return $copy; }