protected function addPlugin($name) { if ($this->isValidPlugin($name) && false === $this->theme->javascripts()->has($key = "prism-{$name}")) { $this->theme->addJavascript($key, $this->getPluginPath($name), ['prism']); if (file_exists(public_path($this->getPluginPath($name) . '.css'))) { $this->theme->addStylesheet($key, $this->getPluginPath($name), ['prism']); } $method = Str::camelize("add-{$name}-plugin"); if (static::hasMacro($method) || method_exists($this, $method)) { $this->{$method}($name); } } }