From e51133fb6a806995bd329413a81bbaf5f5d67d54 Mon Sep 17 00:00:00 2001 From: Muhammad Jawad Date: Tue, 25 Oct 2022 15:43:33 +0500 Subject: [PATCH] Protected the routes with middlewares and added middleware option in config --- src/config.php | 15 +++++++++++++++ src/routes/laravel-grapesjs.php | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/config.php b/src/config.php index 0020881..34354f5 100644 --- a/src/config.php +++ b/src/config.php @@ -13,6 +13,21 @@ 'expose_api' => false, + /* + |-------------------------------------------------------------------------- + | Routes + |-------------------------------------------------------------------------- + | + | Routes Settings + | + */ + + 'routes' => [ + 'middleware' => [ + 'web', 'auth', + ], + ], + /* |-------------------------------------------------------------------------- | Force Class diff --git a/src/routes/laravel-grapesjs.php b/src/routes/laravel-grapesjs.php index fcf7b02..d873209 100644 --- a/src/routes/laravel-grapesjs.php +++ b/src/routes/laravel-grapesjs.php @@ -5,7 +5,7 @@ Route::prefix('laravel-grapesjs') ->name('laravel-grapesjs.') - ->middleware('web') + ->middleware(config('laravel-grapesjs.routes.middleware', [])) ->namespace('Dotlogics\Grapesjs\App\Http\Controllers') ->group(function(){ Route::post('asset/store', 'AssetController@store')->name('asset.store');