/** * Creates a page using the contents of a specified file. * @param string $filePath File containing page contents * @param string $name New Page name * @param string $settings Page settings * @param string $themeCode Theme to create the page * @return void */ protected function createPageFromFile($filePath, $name, $settings, $themeCode) { if (!File::exists($filePath)) { return false; } $page = new Page($themeCode); $page->fill(['fileName' => $name, 'markup' => File::get($filePath), 'settings' => $settings]); $page->save(); return true; }