/** * @param \Illuminate\Http\UploadedFile $file */ public function activate($name) { $theme = Theme::get($name); try { Configuration::create(['website_id' => $this->defaultWebsiteId, 'configuration_key' => 'active_theme_identifier', 'configuration_value' => $name]); Configuration::create(['website_id' => $this->defaultWebsiteId, 'configuration_key' => 'active_theme_path', 'configuration_value' => $theme['path']]); Artisan::call('vendor:publish', ['--tag' => $name]); } catch (Exception $e) { throw new Exception($e->getMessage()); } return redirect()->route('admin.theme.index'); }
public function registerTheme() { $themeInfo = ['name' => 'mage2-basic', 'description' => 'Mage2 Basic Theme', 'path' => __DIR__, 'provider' => self::class, 'assets_folder' => __DIR__ . DIRECTORY_SEPARATOR . 'assets']; Theme::put('mage2-basic', $themeInfo); }