/** * Publish the file to the given path. * * @param string $from * @param string $to */ protected function publishFile($from, $to) { if ($this->files->exists($to) && !$this->option('force')) { return; } $this->createParentDirectory(dirname($to)); $this->files->copy($from, $to); $this->status($from, $to, 'File'); }
/** * Find the given view in the list of paths. * * @param string $name * @param array $paths * * @throws \InvalidArgumentException * * @return string */ public function findInPaths($name, $paths) { foreach ((array) $paths as $path) { foreach ($this->getPossibleViewFiles($name) as $file) { if ($this->files->exists($viewPath = $path . '/' . $file)) { return $viewPath; } } } throw new InvalidArgumentException("View [{$name}] not found."); }
protected function getCompileFiles($location) { $files = []; if ($this->files->exists($location)) { $extension = $this->files->extension($location); if ($extension == 'php') { return include $location; } $paths = $this->files->get($location); $paths = explode("\n", $paths); $paths = array_unique($paths); foreach ($paths as $file) { if (!empty($file) && substr($file, 0, 1) !== '#') { $files[] = $file; } } } return $files; }