diff --git a/src/App/Http/Controllers/EditorController.php b/src/App/Http/Controllers/EditorController.php index c529fe2..0a794b6 100644 --- a/src/App/Http/Controllers/EditorController.php +++ b/src/App/Http/Controllers/EditorController.php @@ -51,7 +51,7 @@ public function templates(Request $request) $file_name = str_replace(".blade.php", "", $fileInfo->getBasename()); $templates [] = [ 'category' => 'Templates', - 'id' => $fileInfo->getFilename(), + 'id' => 'template-' . $fileInfo->getFilename(), 'label' => Str::title(str_replace(["-"], " ", $file_name)), 'content' => view("grapesjs::templates.{$file_name}")->render() ]; @@ -61,9 +61,9 @@ public function templates(Request $request) $file_name = str_replace(".blade.php", "", $fileInfo->getBasename()); $templates [] = [ 'category' => 'Blocks', - 'id' => $fileInfo->getFilename(), + 'id' => 'block-' . $fileInfo->getFilename(), 'label' => Str::title(str_replace(["-"], " ", $file_name)), - 'content' => view("grapesjs::templates.{$file_name}")->render() + 'content' => view("grapesjs::gjs-blocks.{$file_name}")->render() ]; } diff --git a/src/GrapesjsServiceProvider.php b/src/GrapesjsServiceProvider.php index 6a3e760..311ab32 100644 --- a/src/GrapesjsServiceProvider.php +++ b/src/GrapesjsServiceProvider.php @@ -65,7 +65,11 @@ public function publishFiles() $this->publishes([ __DIR__.'/public' => public_path(), - __DIR__.'/../fonts' => public_path('fonts'), + // __DIR__.'/../fonts' => public_path('fonts'), ], 'public'); + + $this->publishes([ + __DIR__.'/resources/views' => resource_path('views'), + ], 'views'); } }