/** * Add the page and page type assets. * * @param PostInterface $post * @throws \Exception */ public function add(PostInterface $post) { /* @var EditorFieldTypePresenter $js */ /* @var EditorFieldTypePresenter $css */ $js = $post->getFieldTypePresenter('js'); $css = $post->getFieldTypePresenter('css'); $this->asset->add('styles.css', $css->path()); $this->asset->add('scripts.js', $js->path()); $type = $post->getType(); $js = $type->getFieldTypePresenter('js'); $css = $type->getFieldTypePresenter('css'); $this->asset->add('styles.css', $css->path()); $this->asset->add('scripts.js', $js->path()); }
public function index(Asset $asset) { $asset->add('scripts.js', 'bloveless.module.migrator::js/admin/column.js'); $tables = DB::select('SHOW TABLES'); $tables = array_flatten(array_map(function ($table) { return array_values((array) $table); }, $tables)); return view('bloveless.module.migrator::admin/columns/index', compact('tables')); }
/** * Handle the command. * * @param Asset $asset * @throws \Exception */ public function handle(Asset $asset) { foreach ($this->builder->getAssets() as $collection => $assets) { if (!is_array($assets)) { $assets = [$assets]; } foreach ($assets as $file) { $filters = explode('|', $file); $file = array_shift($filters); $asset->add($collection, $file, $filters); } } }
public function migrate(Asset $assets) { $assets->add('scripts.js', 'bloveless.module.migrator::js/admin/file.js'); $files = $this->getFilesToMigrate($this->baseUrl); return view('bloveless.module.migrator::admin/file/progress', compact('files')); }