diff --git a/src/config.php b/src/config.php index b00cf8a..3b401ca 100644 --- a/src/config.php +++ b/src/config.php @@ -6,5 +6,8 @@ 'force_class' => false, 'fonts' => [], 'styles' => [], - 'scripts' => [] + 'scripts' => [], + 'middleware' => [ + 'web', 'auth' + ], ]; \ No newline at end of file diff --git a/src/routes/grapesjs.php b/src/routes/grapesjs.php index 8b6ddd6..8b9dc15 100644 --- a/src/routes/grapesjs.php +++ b/src/routes/grapesjs.php @@ -3,12 +3,16 @@ use Illuminate\Support\Facades\Route; -Route::prefix('grapesjs')->name('grapesjs.')->namespace('Dotlogics\Grapesjs\App\Http\Controllers')->group(function(){ - Route::post('editor/asset/store', 'AssetController@store')->name('editor.asset.store'); - - Route::get('editor/{model}/{editable}', 'EditorController@editor')->name('editor.model.editor'); - Route::post('editor/{model}/{editable}', 'EditorController@store')->name('editor.model.store'); - - Route::get('editor/{model}/{editable}/templates', 'EditorController@templates')->name('editor.model.templates'); - Route::get('editor/templates', 'EditorController@templates')->name('editor.templates'); -}); +Route::prefix('grapesjs') + ->name('grapesjs.') + ->namespace('Dotlogics\Grapesjs\App\Http\Controllers') + ->middleware(config('grapesjs.middleware', [])) + ->group(function(){ + Route::post('editor/asset/store', 'AssetController@store')->name('editor.asset.store'); + + Route::get('editor/{model}/{editable}', 'EditorController@editor')->name('editor.model.editor'); + Route::post('editor/{model}/{editable}', 'EditorController@store')->name('editor.model.store'); + + Route::get('editor/{model}/{editable}/templates', 'EditorController@templates')->name('editor.model.templates'); + Route::get('editor/templates', 'EditorController@templates')->name('editor.templates'); + });